| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 346 人关注过本帖
标题:如何移动表单
只看楼主 加入收藏
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
结帖率:97.66%
收藏
已结贴  问题点数:20 回复次数:2 
如何移动表单
当表单宽高大于解析度时...
移动表单包含内置控件~透过一支外挂程序去做上下左右移动~
程序代码:
Option Explicit

Dim fhwnd As Long

'left top Width Height
Private Sub CmdDown_Click()
Dim rtn As Long, MoveW As Long, x1 As Long, y1 As Long
    rtn = GetWindowRect(fhwnd, Rectan)
    x1 = Rectan.Bottom + 10
    MoveW = MoveWindow(fhwnd, x1, y1, Rectan.Right, Rectan.Top, True)
End Sub

Private Sub CmdLeft_Click()
Dim rtn As Long, MoveW As Long
    rtn = GetWindowRect(fhwnd, Rectan)
'    MoveW = MoveWindow(fhwnd, x1, y1, wid, het, True)
End Sub

Private Sub CmdRight_Click()
Dim rtn As Long, MoveW As Long
    rtn = GetWindowRect(fhwnd, Rectan)
'    MoveW = MoveWindow(fhwnd, x1, y1, wid, het, True)
End Sub

Private Sub CmdUp_Click()
Dim rtn As Long, MoveW As Long
    rtn = GetWindowRect(fhwnd, Rectan)
'    MoveW = MoveWindow(fhwnd, x1, y1, wid, het, True)
End Sub

Private Sub Command5_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    Timer1.Enabled = Not Timer1.Enabled
End Sub

Private Sub Command5_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    Timer1.Enabled = Not Timer1.Enabled
End Sub

Private Sub Form_Load()
    Me.Height = CmdDown.Top + CmdDown.Height
    Me.Width = CmdRight.Left + CmdRight.Width
    SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
    Call GetFlowHwnd
End Sub

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = 2 Then
        PopupMenu Menu
    End If
End Sub

Private Sub Timer1_Timer()
Dim P As POINT
    GetCursorPos P
    Me.Left = P.x * 15
    Me.Top = P.y * 15
End Sub

Private Sub bye_Click()
    Unload Me
End Sub

Private Sub GetFlowHwnd()
    fhwnd = FindWindow("ThunderRT6FormDC", "Project Flow")
End Sub
搜索更多相关主题的帖子: 表单 移动 如何 
2012-10-30 12:30
Artless
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:4211
专家分:28888
注 册:2009-4-8
收藏
得分:14 

无知
2012-10-30 12:53
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:23
帖 子:1820
专家分:3681
注 册:2011-3-24
收藏
得分:0 
转到CSDN了就边就先结了...

不要選我當版主
2012-10-30 14:39
快速回复:如何移动表单
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037451 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved