Multi-Line Button?

Hello All,

I need a multi-line button due to the length of the label on it. I can do a multi-line label and make it function like a button, but it does not look like a button with its flat surface.

Any ideas?

Thanks all!
Tim

Rounded corner buttons might allow this but you should really reconsider the wording on your button if it’s that excessively long.

Considering your other post you really should see the apple human interface guidelines.

Hi Tim,

I will take a look at the apple guidelines - although I do not use apple product they still may be beneficial!

The button wording is really not excessive - IMO but opinions are welcome. This is the wording “Add/Delete Messages”

Thanks again Tim,
Tim

For Windows, see the design guidelines for Desktop at
https://msdn.microsoft.com/en-us/library/windows/desktop/dn688964(v=vs.85).aspx

If you absolutely want a multi-line button, the BevelButton takes EndOfLIne to create multiline caption. Probably needs some space padding but it probably can do what you want. Use Rounded bevel to get the kind of old fashion look used last decade.

Use a smaller font size to get your message on 1 line. You’re right, that is not a long msg. Since you apparently want a small button, a smaller font will look better anyway.

Use 2 buttons with + and - instead. Then add some help text. With todays’s odd fashion for obfuscated interfaces + and - without button are okay, too.

If you want to use a text button use some other text. Again for 2 buttons “Add” or “Delete”. But adding and deleting at the same time doesn’t make sense. “Update messages” perhaps or “synchonize”?

Button.Open (BevelButton or PushButton(Square))

me.caption = “Line 1” + EndOfLine + “Line 2”

The idea of the Button width is that all buttons in a window HAVE to have the same with else this will look ugly.

Thanks everyone!

I tried to use the suggested code: me.caption = "Line 1" + EndOfLine + "Line 2" But in both cases, it did not produce a multi-line caption. What did I miss?

Tim

[quote=229721:@Tim Seyfarth]Thanks everyone!

I tried to use the suggested code: me.caption = "Line 1" + EndOfLine + "Line 2" But in both cases, it did not produce a multi-line caption. What did I miss?

Tim[/quote]

BevelButton or Button square style only.

I used BevelButton.

1 Line Height = 20
2 Lines Height = 40

Hi Axel,

Doesn’t matter. It does not work - at least on Win7 64 bit IDE.

Thanks for the effort though!

Tim

I think this is OS specific behavior. It doesn’t work on Windows (that I know of). You might want to reconsider your design. Otherwise, you can use a BevelButton and draw the text into an image that you use as the Icon.

That might be a good rule of thumb for novices, but hardly true in general.

The solution is to place a multiline label onto a ContainerControl, and embed that one into the button.

Just tested on Windows.

I’ve just put a BevelButton onto a Canvas. In the BB Open event I created a picture and did some DrawStrings and then set the BevelButtons Icon property to the picture:

[code]Dim p As Picture
p = New Picture(Me.Width, Me.Height, Screen(0).Depth)
Dim g As Graphics
g = p.graphics

//
g.forecolor= RGB(255, 255, 255) //white
g.drawline 1,1,p.width,1
g.drawline 1,p.height-1,1,1
g.forecolor= RGB(140,140,140) //dark gray
g.drawline p.width-1,2,p.width-1,p.height
g.drawline 1,p.height-1,p.width,p.height-1
//fill in the light gray rectangle
g.forecolor= RGB(239,239,239)
g.fillrect 2,2,p.width-3,p.height-3

g.ForeColor = &c000000
g.DrawString (“Go To”, 12, 15)
g.DrawString (“Appt.”, 14, 30)

me.Icon = p[/code]

It works in Windows!

Cheers, Mac …

Hi Alan,

How do i have those 2 text in the middle meaning centre align??

Hi Richard,
You need to ‘measure’ the width of the text and then centre it. Try this …

[code]s = “My Text”

w = g.StringWidth(s) ’ Get the width
x = (Me.Width - w) / 2 ’ Take ‘w’ away from the width of the button and divide by two to get the ‘left’ measure

g.DrawString( s, x, 24 )[/code]

You can do it for each line.

Mac …