473,898 Members | 3,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UserControl inheritting from Button

Hi,

how can i make a usercontrol that inherits from the
system.windows. forms.button instead of the forms.usercontr ol ?

I want to add a fiew features to my button and still be able to drag it
on to the form with the ide

i got working code, just a class that inherits from
system.windows. forms.button but then i need to do all the design by code
[
dim b as new mybutton
me.controls.add (b)
....
]
So i want to be able to make it a usercontrol... but still have all
standard button-properties (& add a fiew of my own)

thx

Nov 20 '05 #1
3 2362
* sotto <ju**@sotto.inv alid> scripsit:
how can i make a usercontrol that inherits from the
system.windows. forms.button instead of the forms.usercontr ol ?


You cannot create a usercontrol inheriting from button. You can inherit
a control from button:

\\\
Public Class MyButton
Inherits Button

Nov 20 '05 #2
Hi sotto,

If you've changed the inheritence then I assume you're having trouble with
it showing up in the toolbox? Well, to "get around" this, simply build your
application then alter the toolbox, right click then "Add/Remove Items..."
and choose Browse. Then select the application you've just compiled. The
button control will show up in the list and you can drag it around till your
heart's content.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflecti on Master "

==== Converting to 2002 ====
Remove inline declarations
"sotto" <ju**@sotto.inv alid> wrote in message
news:0L******** ************@he stia.telenet-ops.be...
Hi,

how can i make a usercontrol that inherits from the
system.windows. forms.button instead of the forms.usercontr ol ?

I want to add a fiew features to my button and still be able to drag it
on to the form with the ide

i got working code, just a class that inherits from
system.windows. forms.button but then i need to do all the design by code
[
dim b as new mybutton
me.controls.add (b)
...
]
So i want to be able to make it a usercontrol... but still have all
standard button-properties (& add a fiew of my own)

thx

Nov 20 '05 #3
Thx folks ...

i got it working

greetz sotto
--
Merry christmas !!!

Nov 20 '05 #4

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

Similar topics

5
11542
by: C. Alexander | last post by:
I'm trying to create a multi-user interactive whiteboard that has the ability to load a 'background' image to draw ontop of. The client/server needs to load a transparent layer for each user that connects. This is so the individual user layers can be cleared. Each layer is painted on by the user it is assigned to, so the layer must respond to mouse events.
2
2677
by: bill yeager | last post by:
When trying to run my web project, I get the following error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the
1
239
by: sotto | last post by:
Hi, how can i make a usercontrol that inherits from the system.windows.forms.button instead of the forms.usercontrol ? I want to add a fiew features to my button and still be able to drag it on to the form with the ide i got working code, just a class that inherits from system.windows.forms.button but then i need to do all the design by code
0
2481
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls which are not behaving as I would expect. Specifically, if there is a command button external to the usercontrol which is activated by a shortcut key (eg Alt-B), the command button Click event handler code 'executes' even though the textbox set...
1
6885
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle and page loading/rendering lifecycle.... Ok, now for the question: I have an ASPX page (page.aspx), and I have a UserControl (control.ascx). The UserControl has one textbox on the control, and one button control. I have added a public property...
41
4353
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
0
2101
by: oliver | last post by:
QUESTION: How to access an object embedded in a UserControl through Javascript file? Another way to ask this question: How to execute script from a UserControl, accessing other objects in that UserControl? (Script attached to, and executed by, a UserControl embedded server control can ‘see’ the UserControl through the root document architecture. How to get the script to execute and ‘see’ other server controls in the...
10
2441
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's my question. Once the UserControl is dropped onto the container page, how can I perform some action on the codebehind of the container page from the codebehind of the UserControl? For instance, suppose that the UserControl is dropped inside one...
1
18842
by: =?Utf-8?B?S3lsZSBNLiBCdXJucw==?= | last post by:
I have a set of controls and logic that must be invoked from several pages within a web application as a popup dialog, so I intend to use a userControl contained in a panel extended with the modalPopupExtender to get this behavior. I want to deal with showing and hiding the popup in server-side code, so I've set the TargetControlID to a hidden (style=display:none;) button and not set the OkButton or CancelButton. The userControl has...
0
1026
by: Nariban Barkan | last post by:
Hi All, I have two UserControls, KK1 and EFT1. Each one has one ScriptManagerProxy and one UpdatePanel . in addition to these, on first control (KK1) there is one button. on second control (EFT1), there are several textboxes , RequiredFieldValidators for textboxes and one button. I load these usercontrols via the PlaceHolders, like that;
0
9993
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
9840
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11259
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
10483
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
9661
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7187
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
5880
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
6076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4295
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.