#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Msgbox API

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Msgbox API

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Msgbox API

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Msgbox API

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Msgbox API

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Msgbox API

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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox CC Excel Discussion (Misc queries) 4 May 5th 06 05:45 PM
Msgbox Lawson Excel Programming 3 April 6th 04 12:15 AM
MsgBox Help! rbanks Excel Programming 4 November 21st 03 04:17 PM
msgbox Marcus Excel Programming 3 November 19th 03 11:35 PM
MsgBox Phil Perry Excel Programming 1 July 9th 03 07:38 PM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"