Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Found some useful code to customize the msgbox buttons:
http://www.xcelfiles.com The problem is that the msgbox is getting too wide with the buttons way too far to the right. Would there be any solution for this or is it better just to forget about this and use userforms? RBS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi RB
A userform is better for this. See http://www.dicks-blog.com/archives/2...message-boxes/ HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Found some useful code to customize the msgbox buttons: http://www.xcelfiles.com The problem is that the msgbox is getting too wide with the buttons way too far to the right. Would there be any solution for this or is it better just to forget about this and use userforms? RBS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Harald,
Thanks for the tip. I had a look at the website, but there has to be a lot more code in the userform to adapt it to all the possible parameters such as the amount of text in the message and the button captions. Also you may need more buttons or less. I would be interested if somebody had worked this all out. RBS "Harald Staff" wrote in message ... Hi RB A userform is better for this. See http://www.dicks-blog.com/archives/2...message-boxes/ HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Found some useful code to customize the msgbox buttons: http://www.xcelfiles.com The problem is that the msgbox is getting too wide with the buttons way too far to the right. Would there be any solution for this or is it better just to forget about this and use userforms? RBS |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi RB
There are literally thousands of variables here, including different length of statements for different languages. Ans at most points it will look pretty ugly. But you can autosize buttons pretty easy by having a label on the userform with the same font, fill it with text and autosize it: Sub SetBtn1(Txt As String) With Me.Lbl1 .Visible = False .AutoSize = False .Width = 300 .Caption = Txt .AutoSize = True End With DoEvents With Me.Btn1 .Width = Me.Lbl1.Width + 16 .Caption = Txt End With End Sub HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Harald, Thanks for the tip. I had a look at the website, but there has to be a lot more code in the userform to adapt it to all the possible parameters such as the amount of text in the message and the button captions. Also you may need more buttons or less. I would be interested if somebody had worked this all out. RBS "Harald Staff" wrote in message ... Hi RB A userform is better for this. See http://www.dicks-blog.com/archives/2...message-boxes/ HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Found some useful code to customize the msgbox buttons: http://www.xcelfiles.com The problem is that the msgbox is getting too wide with the buttons way too far to the right. Would there be any solution for this or is it better just to forget about this and use userforms? RBS |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Harald,
Will try that. Is there really no way then with API to customize the text on the buttons without messing up the whole layout of the messagebox? This is all I need. RBS "Harald Staff" wrote in message ... Hi RB There are literally thousands of variables here, including different length of statements for different languages. Ans at most points it will look pretty ugly. But you can autosize buttons pretty easy by having a label on the userform with the same font, fill it with text and autosize it: Sub SetBtn1(Txt As String) With Me.Lbl1 .Visible = False .AutoSize = False .Width = 300 .Caption = Txt .AutoSize = True End With DoEvents With Me.Btn1 .Width = Me.Lbl1.Width + 16 .Caption = Txt End With End Sub HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Harald, Thanks for the tip. I had a look at the website, but there has to be a lot more code in the userform to adapt it to all the possible parameters such as the amount of text in the message and the button captions. Also you may need more buttons or less. I would be interested if somebody had worked this all out. RBS "Harald Staff" wrote in message ... Hi RB A userform is better for this. See http://www.dicks-blog.com/archives/2...message-boxes/ HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Found some useful code to customize the msgbox buttons: http://www.xcelfiles.com The problem is that the msgbox is getting too wide with the buttons way too far to the right. Would there be any solution for this or is it better just to forget about this and use userforms? RBS |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Variable text length / button count / button width is a bad looking mess
already, no matter which platform you play it on. Maybe it's A way somewhere, but it will not be a better way than a userform. All you need is love. HTH. Best wishes Harald "RB Smissaert" skrev i melding ... Harald, Is there really no way then with API to customize the text on the buttons without messing up the whole layout of the messagebox? This is all I need. |