掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ツールバーボタンのValueプロパティを操作するには? (ID:77411)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
Toolbar1.Buttons(インデックス).Value = tbrPressed のかわりに、 Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Type POINTAPI x As Long y As Long End Type Private Type WINDOWPLACEMENT Length As Long flags As Long showCmd As Long ptMinPosition As POINTAPI ptMaxPosition As POINTAPI rcNormalPosition As RECT End Type Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long と宣言して、たとえば Private Sub Command1_Click() Dim wPos As WINDOWPLACEMENT, cPos As POINTAPI wPos.Length = Len(wPos) GetWindowPlacement hwnd, wPos ShowCursor 0 GetCursorPos cPos SetCursorPos wPos.rcNormalPosition.Left + 4 + (Toolbar1.Buttons(2).Left \ 15), wPos.rcNormalPosition.Top + 26 + (Toolbar1.Buttons(2).Top \ 15) mouse_event 2, 0, 0, 0, 0 mouse_event 4, 0, 0, 0, 0 SetCursorPos cPos.x, cPos.y ShowCursor 1 End Sub のようにすればよいと思います。(長くてすみません。)
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.