在窗体中调用记事本
2006-04-08 15:18
253 查看
Option Explicit
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _
As Long
Private Const TVS_NOTOOLTIPS = &H80
Private Const GWL_STYLE = (-16)
Private Sub ShowToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles And (Not TVS_NOTOOLTIPS)
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
Private Sub HideToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles Or TVS_NOTOOLTIPS
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
Private Sub Command1_Click()
HideToolTips Me.TreeView1
End Sub
Private Sub Command2_Click()
ShowToolTips Me.TreeView1
End Sub
Private Sub Form_Load()
Command1.Caption = "隐藏ToolTips"
Command2.Caption = "显示ToolTips"
Dim i As Long
For i = 1 To 100
Me.TreeView1.Nodes.Add , , , "hello this is test hello this is test hello this is test" & CStr(i)
Next
End Sub
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _
As Long
Private Const TVS_NOTOOLTIPS = &H80
Private Const GWL_STYLE = (-16)
Private Sub ShowToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles And (Not TVS_NOTOOLTIPS)
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
Private Sub HideToolTips(TreeView As TreeView)
Dim nStyles As Long
With TreeView
nStyles = GetWindowLong(.hwnd, GWL_STYLE)
nStyles = nStyles Or TVS_NOTOOLTIPS
SetWindowLong .hwnd, GWL_STYLE, nStyles
End With
End Sub
Private Sub Command1_Click()
HideToolTips Me.TreeView1
End Sub
Private Sub Command2_Click()
ShowToolTips Me.TreeView1
End Sub
Private Sub Form_Load()
Command1.Caption = "隐藏ToolTips"
Command2.Caption = "显示ToolTips"
Dim i As Long
For i = 1 To 100
Me.TreeView1.Nodes.Add , , , "hello this is test hello this is test hello this is test" & CStr(i)
Next
End Sub
相关文章推荐
- 如何跨越线程调用窗体上的控件
- 对 Windows 窗体控件进行线程安全调用
- 在C#中调用系统API使窗体下拥有阴影效果
- 如何:对 Windows 窗体控件进行线程安全调用
- 窗体之间调用方法--使用静态成员
- C#中跨线程调用windows窗体控件
- 窗体调用2.0
- 关于C#窗体应用程序调用google翻译api的问题
- [C#新手入门 一] 调用API函数给Winform窗体添加动态特效(转)
- 如何跨越线程调用窗体控件?(3)
- 在MDI窗体调用子窗体时怎样使不被MDI窗体上的图片挡住
- 关于多线程环境下安全调用窗体控件方法
- winform 拖动无边框窗体(调用Windows API)
- VC窗体关闭时,销毁函数调用顺序
- c#中跨线程调用windows窗体控件
- c#中如何跨线程调用windows窗体控件?
- .net跨窗体调用控件
- 程序运行时,利用反射调用不同窗体
- c#Winform中调用WPF窗体
- C# WinForm 窗体应用程序,调用 javascript 脚本