22.右鍵托盤圖標后必須電擊他才可以消失,怎么辦? Case WM_RBUTTONUP '鼠標在圖標上右擊時彈出菜單
SetForegroundWindow Me.hwnd
Me.PopupMenu mnuTray
加一句 SetForegroundWindow Me.hwnd
23. 將progressbar嵌入statusbar中 - Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal _ hWndNewParent As Long) As Long
- Private Sub Command1_Click()
- With ProgressBar1
- .Max = 1000
- Dim i As Integer
- For i = 1 To 1000
- .Value = i
- Next i
- End With
- End Sub
- Private Sub Form_Load()
- ProgressBar1.Appearance = ccFlat
- SetParent ProgressBar1.hWnd, StatusBar1.hWnd
- ProgressBar1.Left = StatusBar1.Panels(1).Left
- ProgressBar1.Top = 100
- ProgressBar1.Width = StatusBar1.Panels(1).Width - 50
- ProgressBar1.Height = StatusBar1.Height - 150
- End Sub '相對位置你可以自己再調一下
復制代碼 24.使你的程序界面具有XP風格 產生一個和你的可執(zhí)行程序同名的后綴為exe.manifest的文件,并和可執(zhí)行文件放在同一路徑中。
代碼中加入:
- Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
- Private Sub Form_Initialize()
- InitCommonControls
- End Sub
復制代碼注意:
1 工具欄控件一定要用Microsoft Windows Common Controls 5.0,而不要用Microsoft Windows Common Controls 6.0。因為此
InitCommonControls API函數是位于comctl32.dll(Microsoft Windows Common Controls 5.0控件的動態(tài)鏈接庫中)。
2 放在FRAME控件中的單遠按鈕有些“麻煩”!為了解決此問題,可以將單選按鈕放在PICTURE控件中(以PICTURE控件作為容器),再將
PICTURE控件放在FRAME控件中,就可以了。
3 必須編譯之后才能看到效果
exe.manifest文件中的內容,可用notepad編輯。
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity
- version="1.0.0.0"
- processorArchitecture="X86"
- name="CompanyName.ProductName.YourApp"
- type="win32"
- />
- <description>Your application description here.</description>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity
- type="win32"
- name="Microsoft.Windows.Common-Controls"
- version="6.0.0.0"
- processorArchitecture="X86"
- publicKeyToken="6595b64144ccf1df"
- language="*"
- />
- </dependentAssembly>
- </dependency>
- </assembly>
復制代碼
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現有害或侵權內容,請
點擊舉報。