Hi,
i am using code like in attachment to change text buttons on msgbox:
Screenshot_15.png
This is open code.
What i need is to adjust length of buttons to have fully text visible (now is cutted).
Can you help with this?
Best Wishes,
Jacek
Hi,
i am using code like in attachment to change text buttons on msgbox:
Screenshot_15.png
This is open code.
What i need is to adjust length of buttons to have fully text visible (now is cutted).
Can you help with this?
Best Wishes,
Jacek
Last edited by jaryszek; 04-07-2019 at 05:43 AM.
That's an awful lot of code if all it's doing is showing a message box and controlling the size of the buttons!
Why not just create a userform that looks and acts like a message box and call that in stead? That way you can easily size the buttons how you want them.
BSB
Hi BadlySpelledBuoy,
thank you very much.
Yes i can do it via userform but maybe somebody knows windows hook class to do it in very simple way and provide solution.
Best Wishes,
Jacek
Anyone knows this class inside workbook?
This is Windows Hooking API.
Best,
Jacek
Last edited by jaryszek; 04-08-2019 at 06:54 AM.
There is no simple way with API. Your hook is responding after the messagebox has already been created so the size of its elements is already set. You'd need a whole load of code to resize and reposition the various elements. A userform will be the simple way.
Everyone who confuses correlation and causation ends up dead.
Thank you Rory!
hmm ok hmm it is possible to lock exit button on userform like in attached msgbox (it is turned off).
Best,
Jacek
small peace of code to do that..
see this page http://spreadsheetpage.com/index.php..._close_button/
![]()
Private Sub UserForm_QueryClose _ (Cancel As Integer, CloseMode As Integer) ' Prevents use of the Close button If CloseMode = vbFormControlMenu Then MsgBox "Clicking the Close button does not work." Cancel = True End If End Sub
Just trap the Userform_QueryClose event and test the closemode to see if the X was pressed:
for example to just stop it working. You can also simply unload, etc.![]()
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True End Sub
Thank you!
I am closing the topic
Best
Jacek
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks