发过一个帖 只是说可以动态创建
最后用了控件数组 一个隐藏的控件 然后load它
Static n As Integer
If n <>0 Then Load Label1(n)
Label1(n).Move 300, 200 + n *500
Label1(n).Visible = True
n = n + 1
可是这样创建出来的控件 无法拖拉 改变大小
(我是在 softcircuits 的那个可以拖拉控件的程序上改的 这个程序只对预先放在FORM上的控件有效果?)
对于动态创建的control不能在
dim i as long
for i = 0 to controls.count
里面找到?
那么我该如何解决 这个问题
最后用了控件数组 一个隐藏的控件 然后load它
Static n As Integer
If n <>0 Then Load Label1(n)
Label1(n).Move 300, 200 + n *500
Label1(n).Visible = True
n = n + 1
可是这样创建出来的控件 无法拖拉 改变大小
(我是在 softcircuits 的那个可以拖拉控件的程序上改的 这个程序只对预先放在FORM上的控件有效果?)
对于动态创建的control不能在
dim i as long
for i = 0 to controls.count
里面找到?
那么我该如何解决 这个问题
脱动COMMAND为例
Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
ReleaseCapture
SendMessage Command1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
End Sub
bdsnd = Not bdsnd
Dim NewStyle As Long
NewStyle = GetWindowLong(ControlName.hwnd, GWL_STYLE)
If bdsnd = True Then
NewStyle = NewStyle Or WS_THICKFRAME
Else
NewStyle = NewStyle - WS_THICKFRAME
End If
NewStyle = SetWindowLong(text(n).hwnd, GWL_STYLE, NewStyle)
SetWindowPos ControlName.hwnd, FormName.hwnd, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
End Sub不过这种NewStyle = NewStyle - WS_THICKFRAME
好象很危险 有时候会出现其他的状态
这是为什么?to daisy8675(莫依)
应该如何学习WINDOWS程序设计
现在我都是遇到问题找资料 然后改
感觉 自己写不出什么东西 :(