论坛上找了很旧,没找到!问题:
1、如何设置ComboBox的高度?
2、哪里可以找到有关API的所有常数?
1、如何设置ComboBox的高度?
2、哪里可以找到有关API的所有常数?
解决方案 »
- 现在有Text和DTPicker孔件,请问怎么来组合进行查询??
- 加壳怎么程序变大了20倍???
- 感谢jinta2001()结分帖
- 当记录集移动时(即记录集的WillMove事件发生时),作一个判断,如果条件成立,就移动记录,不成立就不移动记录,该怎么做?
- 分不在多,心诚则灵
- 找不到dll入口点 shell_notifyiconA in shell32.dll
- 动态创建控件后,我怎么调用控件的方法。分不够再加。
- 怎样判断一个文件是否存在?怎样彻底删除一个文件?
- 什么叫 “Option Base”,谢谢!
- 怎样得到计算机的Ip地址?
- SQL2000 的"Insert"问题!
- imager控件的问题,望高手指点!
Option ExplicitPrivate Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End TypePrivate Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function SendMessageLong Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As LongPublic Function ComboHeight(Combo As ComboBox, _
ByVal Height As Single, Optional ByVal ScaleMode = -1) _
As Single Dim nHeight As Long
Dim nScaleMode As Integer
Dim nHeightDiff As Long
Dim nRect As RECT
Dim nOldHeight As Long
Dim nOldComboHeight As Long
Const CB_GETITEMHEIGHT = &H154
Const CB_SETITEMHEIGHT = &H153
With Combo
GetWindowRect .hwnd, nRect
nOldHeight = SendMessageLong(.hwnd, CB_GETITEMHEIGHT, -1, 0)
nOldComboHeight = nRect.Bottom - nRect.Top
nHeightDiff = nOldComboHeight - nOldHeight
If ScaleMode = -1 Then
On Error Resume Next
nScaleMode = .Container.ScaleMode
If Err.Number Then
nScaleMode = vbTwips
End If
On Error GoTo 0
Else
nScaleMode = ScaleMode
End If
On Error Resume Next
nHeight = .Parent.ScaleY(Height, nScaleMode, vbPixels)
If Err.Number Then
If ScaleMode = vbPixels Then
nHeight = Height
ComboHeight = nOldComboHeight
Else
nHeight = Height \ Screen.TwipsPerPixelY
ComboHeight = nOldComboHeight * Screen.TwipsPerPixelY
End If
Else
ComboHeight = _
.Parent.ScaleY(nOldComboHeight, vbPixels, nScaleMode)
End If
On Error GoTo 0
SendMessageLong .hwnd, CB_SETITEMHEIGHT, -1, _
nHeight - nHeightDiff
End With
End Function'调用
Private Sub Command1_Click()
ComboHeight Me.Combo1, 400
End Sub
//哪里可以找到有关API的所有常数
印象中好象没有这样的地方,如果你找到了,记得告诉我:) api浏览器中,有大部分常用常数的声明