Need Special Button Control - act like Toolbar button

T

Tom

I need to either find or create a special button control - one that acts
like a toolbar button does, but in a separate control. I.E., it needs to be
able to have a dropdown menu (with the arrow button next to it), or be a
plain button, etc etc. Pretty much all of the features a toolbar button
does, but not in a tool bar control.

I can write one myself, but would rather not reinvent the wheel. Anyone know
of a control like this? With source code? Otherwise I'll start writing it...
Thanks!

Tom
 
J

Jeff Law

Why not just use a Toolbar control, with only one button, having the
drop-down, and the Dock property set to None so that you can place it where
you want?

Jeff Law
New Zealand
 
T

Tom

Jeff: Originally that is what I have done; however, I have to add two
additional buttons. But here is the kicker: The buttons on the toolbar (if I
use that control) have to be different sizes. I E. My old button (button1)
has to be a larger size, whereas the two new buttons have to be MUCH
smaller. As I see it, individual buttons cannot be sized differently. Only
by using ToolBar.ButtonSize can you resize buttons, and it appears they have
to all be the same size.

Now, if you have a way around this, then using the toolbar may work;
otherwise, I am going to have to look to some other control.

Tom
 
C

Cor Ligthert

Jeff: Originally that is what I have done; however, I have to add two
additional buttons. But here is the kicker: The buttons on the toolbar (if I
use that control) have to be different sizes. I E. My old button (button1)
has to be a larger size, whereas the two new buttons have to be MUCH
smaller. As I see it, individual buttons cannot be sized differently. Only
by using ToolBar.ButtonSize can you resize buttons, and it appears they have
to all be the same size.
Tom when you set size automatic, that is even done automaticly concording
the lenght of what you have on it. (Width)

Cor
 
J

Jeff Law

Tom,

I may be misunderstaning your requirement, but couldn't you have
multiple one-button Toolbar controls?

That way, you can have differing button sizes.

Jeff Law
DataMasta Limited
New Zealand
 
T

Tom

Jeff: True... I didn't think of that.... however, I do see one problem with
this. The issue is that I automatically resize my first button depending on
the text that is in it. In other words, if the text in the button is ABC123,
the button will be of a shorter length. However, if it is something like
'The cat jumped over the dog' then of course the button will be much larger.
In order to use two toolbars, I suppose I would have to catch this and then
automatically resize both the first button bar, and then move the second
button bar so that it is behind the first one. I don't think anchor will
work for this.

I'm going to try this out though, maybe the resizing wouldn't be that hard
to do.

Tom
 
T

Tom

Jeff: Thanks that did the trick. I was able to manipulate the bar so that
when I resize the text button I also resize the control and then move the
next toolbar over to the end of the first. Works great.

Thanks again.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top