473,414 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Why is ToolBarButton class not a control?

It seems to me that the ToolBarButton should be a control, but instead it
inherits from Component. Is there a reason this could not have inherited
from Control since really a ToolBarButton is nothing more then a button with
additional features?

Nov 17 '05 #1
2 1329
"Peter Rilling" <pe***@nospam.rilling.net> wrote:
It seems to me that the ToolBarButton should be a
control, but instead it inherits from Component. Is
there a reason this could not have inherited from
Control since really a ToolBarButton is nothing more
then a button with additional features?


I doubt that every button on a toolbar is really implemented as a
regular button. More probably, the "buttons" on a toolbar are
something like the items in a ListView, or the individual checkboxes
in a CheckedListBox: it's the responsibility of the parent control to
paint them all.

Is there something you're trying to do that you can't achieve this
way?

P.
Nov 17 '05 #2
I just had code that tracks the location of a control and wanted to expand
it to the toolbar buttons. Right now I have a constructor that takes a
Control object. This means that any control can be monitored by my class.
Now, if I want a ToolBarButton to be tracked, I have to add a new
constructor for this and generalize some of my code. Although it is not a
problem, it just means more methods.

I just thought that it really should have been a control since it has visual
characteristics and has behavior like all other controls. The ToolBar could
have been something like a Panel (or some other container), that allowed
other controls to be embedded.
"Paul E Collins" <fi******************@CL4.org> wrote in message
news:dh**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
"Peter Rilling" <pe***@nospam.rilling.net> wrote:
It seems to me that the ToolBarButton should be a
control, but instead it inherits from Component. Is
there a reason this could not have inherited from
Control since really a ToolBarButton is nothing more
then a button with additional features?


I doubt that every button on a toolbar is really implemented as a regular
button. More probably, the "buttons" on a toolbar are something like the
items in a ListView, or the individual checkboxes in a CheckedListBox:
it's the responsibility of the parent control to paint them all.

Is there something you're trying to do that you can't achieve this way?

P.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cody | last post by:
i can't figure out how to manually open the DropDown menu which is associated to my ToolBarbutton. i want to open it when the user presses a certain key. -- cody Freeware Tools, Games and...
0
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I...
1
by: geoff | last post by:
I am trying to learn how to create my own controls. I want to create my own toolbar which would be similar to the .net toolbar except that my version would allow 3 images per button (off, over,...
1
by: Tulasi | last post by:
Is there any possibility to set ToolBarButton back color.
0
by: Brian Binnerup | last post by:
Hi. I am using the ms:ToolBar control on one of our products, and now a customer whishes for it to be with a dark blue background - I can do that by specifying a style on the ms:ToolBar tag -...
5
by: Barry Gast | last post by:
Hi. I am trying to access the names of the toolbar buttons in order to match to correct button name passed to a function. However, there is no ..Name property on a ToolBarButton control. Is...
3
by: Tom | last post by:
Hi Hi i am trying to draw on top of a button on a standard toolbar. All i want to do is draw a small rectangle on the button to represent the selected color. I have tried the folowing code in...
4
by: Ahmed | last post by:
Hi everyone, Is there a way to add a toolbarbutton with dropdown menu similar to the mail button in IE? In another word, when the chevron is part of the button not beside it. Thanks Ahmed
0
by: Steven | last post by:
Hi, I have a toolbar control with several buttons in ToolBarButton class. How can I change the text color of the ToolBarButton control in VB.NET 2003? Thanks! Steven
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.