473,842 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1347
"Peter Rilling" <pe***@nospam.r illing.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.r illing.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
1074
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 Humour http://www.deutronium.de.vu
0
1400
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 would like to clean it up. Instead of using the gray mask, I want to use my own grayscaled high quality image. I thought by simply setting button.ImageIndex = new_num; (where new_num is the index of the grayscale image) I could do this. But alas, that...
1
1252
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, down). I haven't been able to find anything on msdn on extending the toolbarbutton control to add in this functionality. Has anyone seen an online tutorial on the subject or something related? Thanks.
1
1627
by: Tulasi | last post by:
Is there any possibility to set ToolBarButton back color.
0
1009
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 - but I can't set neither a style or a class on the ms:ToolbarButton tag, which means that there will be black text on dark blue background - and the text therefore cannot be read. Can I in ANY way control the text color of the ms:ToolBarButton?
5
1288
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 there any other way to access the name of the toolbarbutton? Thanks. -Barry
3
1642
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 the toolbar's parent control, which is fired when the selected color is changed: Dim r As Rectangle = FontColorButton.Rectangle
4
1470
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
956
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
9878
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10965
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10326
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7050
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5705
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4102
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3154
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.