473,778 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a "base" button

Can I create a "base" button that all the buttons in my Windows Forms can
inherit from?

Thanks.
VS2005
Jul 13 '07 #1
6 1566
Hi,

Why not? Create the custom button and place it (or many) onto the form.

Regards, Alex
[TechBlog] http://devkids.blogspot.com
Can I create a "base" button that all the buttons in my Windows Forms
can inherit from?

Thanks.
VS2005

Jul 13 '07 #2
How co I create a custom button?
"Alex Meleta" <am*****@gmail. comwrote in message
news:20******** *************** ***@msnews.micr osoft.com...
Hi,

Why not? Create the custom button and place it (or many) onto the form.

Regards, Alex
[TechBlog] http://devkids.blogspot.com
>Can I create a "base" button that all the buttons in my Windows Forms
can inherit from?

Thanks.
VS2005


Jul 13 '07 #3
Hi,

Just like any custom controls (in your case as inherited class of Button):

public class CustomButton : Button
{
/// ....
}

You can learn a bit there: http://samples.gotdotnet.com/quickst...gControls.aspx

Regards, Alex
[TechBlog] http://devkids.blogspot.com
How co I create a custom button?
"Alex Meleta" <am*****@gmail. comwrote in message
news:20******** *************** ***@msnews.micr osoft.com...
>Hi,

Why not? Create the custom button and place it (or many) onto the
form.

Regards, Alex
[TechBlog] http://devkids.blogspot.com
>>Can I create a "base" button that all the buttons in my Windows
Forms can inherit from?

Thanks.
VS2005

Jul 13 '07 #4
Hi Doc,

It's easy to create a custom button.

To do this, create a new class inherited from the
System.Windows. Forms.Button class and add some custom properites or
override some methods in the new class, if necessary.

After you finish the custom button, build the project.

To create a button that is derived from the custom button in the same
project, make the new class inherited from the custom button. The following
is a sample.

public class MyButton:Custom Button
{
....
}

If you'd like to inherit a new class from the custom button in a new
project, add a reference to the project or assembly that contains the
custom button in the new project and then make the new class inherited from
the custom button.

Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 16 '07 #5
.... or implement IButtonControl.
http://www.dotnetrix.co.uk/buttons.html

--
Mick Doherty
http://www.dotnetrix.co.uk/nothing.html
"Linda Liu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:Ku******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Doc,

It's easy to create a custom button.

To do this, create a new class inherited from the
System.Windows. Forms.Button class and add some custom properites or
override some methods in the new class, if necessary.

After you finish the custom button, build the project.

To create a button that is derived from the custom button in the same
project, make the new class inherited from the custom button. The
following
is a sample.

public class MyButton:Custom Button
{
....
}

If you'd like to inherit a new class from the custom button in a new
project, add a reference to the project or assembly that contains the
custom button in the new project and then make the new class inherited
from
the custom button.

Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 16 '07 #6
Hi Doc,

How about the problem now?

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Jul 18 '07 #7

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

Similar topics

21
2162
by: Alex Martelli | last post by:
I hesitate a bit to post this, but... on the Italian Python NG, somebody was asking whether there was any way to convert an integer number x into a string which represents it in an arbitrary base N (given a sequence with a len of N that gives the digits to use) as "a single expression". I haven't found a really general way, much less a clear one, but, the best I have so far is...: def number_in_base(x, N, digits, maxlen=99): return...
11
2104
by: Joseph Turian | last post by:
Fellow hackers, I have a class BuildNode that inherits from class Node. Similarly, I have a class BuildTree that inherits from class Tree. Tree includes a member variable: vector<Node> nodes; // For clarity, let this be "orig_nodes" BuildTree includes a member variable:
4
1762
by: Gecko | last post by:
I noticed that every time I override a class member, the intellisense behavior is to automatically add a call to the base class of the overridden member such as: public override void SomeMethod() { /// Some quality code goes here. base.SomeMethod(); }
2
1718
by: Wade | last post by:
Hi all, We have created some "Base" class pages for our WebForms and UserControls. For instance, when we create a WebForm called "WebForm1.aspx", instead of inheriting from "System.Web.UI.Page" we implement from our "Base" class page which itself inherits from "System.Web.UI.Page" -- I know, pretty standard. We do the same with our UserControls, instead they inherit from "System.Web.UI.UserControl". Now, there are some methods that we...
7
2249
by: relient | last post by:
Question: Why can't you access a private inherited field from a base class in a derived class? I have a *theory* of how this works, of which, I'm not completely sure of but makes logical sense to me. So, I'm here for an answer (more of a confirmation), hopefully. First let me say that I know people keep saying; it doesn't work because the member "is a private". I believe there's more to it than just simply that... Theory: You inherit,...
2
2199
by: qazmlp1209 | last post by:
class base { public: base() { } base(int number) { priNumber = number ;
3
1588
by: Rob | last post by:
I have these classes (elided methods): class Base { public: Base(string name) {...} }; class Derived : public Base {
3
1669
by: Ravi | last post by:
Is this the correct way to think of "base class"? The "base class" is a class from which other classes are derived. The "base class" will never be derived from another class.
18
2462
by: Stephan Beal | last post by:
Hi, all! Before i ask my question, i want to clarify that my question is not about the code i will show, but about what the C Standard says should happen. A week or so ago it occurred to me that one can implement a very basic form of subclassing in C (the gurus certainly already know this, but it was news to me). What i've done (shown below) seems to work all fine and well, and does exactly what i'd expect, but i'm asking about
0
9629
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
10298
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
10127
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
9923
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
6723
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
5370
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
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2865
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.