473,414 Members | 1,675 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.

Derived Button Control Subclass Issue

There is a C# CTI app I'm working on using Visual Studio 2005 at
revision level 8.0.50727-7600. I need a couple of Windows Form Button
controls to emulate line buttons on a telephone. So I went to create a
class file for the user control to subclass this out. Something basic
for a start, just initializing things. When I drag this custom control
from the Toolbox to my form then Visual Studio just abruptly exits
without warning.

So I tried to create a custom button control as part of a custom
Control Library DLL file. When I add this reference to a new project
and then try to drag in the custom control the same thing happens.
Visual Studio just vanishes.

I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.

Has anyone else experienced something similar?

Jun 6 '07 #1
5 2799
On Jun 6, 8:05 am, gregarican <greg.kuj...@gmail.comwrote:
There is a C# CTI app I'm working on using Visual Studio 2005 at
revision level 8.0.50727-7600. I need a couple of Windows Form Button
controls to emulate line buttons on a telephone. So I went to create a
class file for the user control to subclass this out. Something basic
for a start, just initializing things. When I drag this custom control
from the Toolbox to my form then Visual Studio just abruptly exits
without warning.

So I tried to create a custom button control as part of a custom
Control Library DLL file. When I add this reference to a new project
and then try to drag in the custom control the same thing happens.
Visual Studio just vanishes.

I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.

Has anyone else experienced something similar?
When you say you want to emulate line buttons on a telephone, what do
you mean? Do you mean buttons that select the particular phone line
to use? Have you tried using a RadioButton with its appearance set to
Button?

I'm sorry I don't have a solution for your crashing VS problem.

Chris

Jun 6 '07 #2
Hi,

"gregarican" <gr*********@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
>
I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.

Has anyone else experienced something similar?
Not, I have never seen VS crash like that.

Are you sure you are following all the steps to make your new control
available from the toolbox?

If so I suggest you to create a bug report with MS regarding this.
Sorry not be able to help you more.
--
Ignacio Machin
machin AT laceupsolutions com
Jun 6 '07 #3
On Jun 6, 9:28 am, Chris Dunaway <dunaw...@gmail.comwrote:
On Jun 6, 8:05 am, gregarican <greg.kuj...@gmail.comwrote:


There is a C# CTI app I'm working on using Visual Studio 2005 at
revision level 8.0.50727-7600. I need a couple of Windows Form Button
controls to emulate line buttons on a telephone. So I went to create a
class file for the user control to subclass this out. Something basic
for a start, just initializing things. When I drag this custom control
from the Toolbox to my form then Visual Studio just abruptly exits
without warning.
So I tried to create a custom button control as part of a custom
Control Library DLL file. When I add this reference to a new project
and then try to drag in the custom control the same thing happens.
Visual Studio just vanishes.
I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.
Has anyone else experienced something similar?

When you say you want to emulate line buttons on a telephone, what do
you mean? Do you mean buttons that select the particular phone line
to use? Have you tried using a RadioButton with its appearance set to
Button?

I'm sorry I don't have a solution for your crashing VS problem.

Chris- Hide quoted text -

- Show quoted text -
There are several different states of a LineButton control that I
wanted to use. It is either ringing, idle, or holding a call. I
figured I could subclass a Button control and then add Property gets
and sets for these states. A RadioButton control wouldn't offer me the
same clean feature set since I want to conditionally change the
BackColor, Image, and other things as well.

I will read up some more on the recommended steps of subclassing an
existing Windows Form control and ensure I'm going through the steps
correctly as the other poster suggested. We'll see...

Jun 6 '07 #4
On Jun 6, 4:54 pm, gregarican <greg.kuj...@gmail.comwrote:
On Jun 6, 9:28 am, Chris Dunaway <dunaw...@gmail.comwrote:
On Jun 6, 8:05 am, gregarican <greg.kuj...@gmail.comwrote:
There is a C# CTI app I'm working on using Visual Studio 2005 at
revision level 8.0.50727-7600. I need a couple of Windows Form Button
controls to emulate line buttons on a telephone. So I went to create a
class file for the user control to subclass this out. Something basic
for a start, just initializing things. When I drag this custom control
from the Toolbox to my form then Visual Studio just abruptly exits
without warning.
So I tried to create a custom button control as part of a custom
Control Library DLL file. When I add this reference to a new project
and then try to drag in the custom control the same thing happens.
Visual Studio just vanishes.
I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.
Has anyone else experienced something similar?
When you say you want to emulate line buttons on a telephone, what do
you mean? Do you mean buttons that select the particular phone line
to use? Have you tried using a RadioButton with its appearance set to
Button?
I'm sorry I don't have a solution for your crashing VS problem.
Chris- Hide quoted text -
- Show quoted text -

There are several different states of a LineButton control that I
wanted to use. It is either ringing, idle, or holding a call. I
figured I could subclass a Button control and then add Property gets
and sets for these states. A RadioButton control wouldn't offer me the
same clean feature set since I want to conditionally change the
BackColor, Image, and other things as well.

I will read up some more on the recommended steps of subclassing an
existing Windows Form control and ensure I'm going through the steps
correctly as the other poster suggested. We'll see...
Hi,

What do you mean by subclassing? Inheritance?

There shouldn't be a problem inheriting a windows forms control (that
is inheritable).

Moty

Jun 6 '07 #5
On Jun 6, 10:33 am, Moty Michaely <Moty...@gmail.comwrote:
On Jun 6, 4:54 pm, gregarican <greg.kuj...@gmail.comwrote:


On Jun 6, 9:28 am, Chris Dunaway <dunaw...@gmail.comwrote:
On Jun 6, 8:05 am, gregarican <greg.kuj...@gmail.comwrote:
There is a C# CTI app I'm working on using Visual Studio 2005 at
revision level 8.0.50727-7600. I need a couple of Windows Form Button
controls to emulate line buttons on a telephone. So I went to create a
class file for the user control to subclass this out. Something basic
for a start, just initializing things. When I drag this custom control
from the Toolbox to my form then Visual Studio just abruptly exits
without warning.
So I tried to create a custom button control as part of a custom
Control Library DLL file. When I add this reference to a new project
and then try to drag in the custom control the same thing happens.
Visual Studio just vanishes.
I have tried subclassing the Button class, the UserControl class, the
Control class, etc. All with the same result. I have tried each time
with just a new project with nothing else in it other than the default
elements. When I try this out on another PC using Visual C# 2005
Express it works fine and I can drop in the custom button control
without incident.
Has anyone else experienced something similar?
When you say you want to emulate line buttons on a telephone, what do
you mean? Do you mean buttons that select the particular phone line
to use? Have you tried using a RadioButton with its appearance set to
Button?
I'm sorry I don't have a solution for your crashing VS problem.
Chris- Hide quoted text -
- Show quoted text -
There are several different states of a LineButton control that I
wanted to use. It is either ringing, idle, or holding a call. I
figured I could subclass a Button control and then add Property gets
and sets for these states. A RadioButton control wouldn't offer me the
same clean feature set since I want to conditionally change the
BackColor, Image, and other things as well.
I will read up some more on the recommended steps of subclassing an
existing Windows Form control and ensure I'm going through the steps
correctly as the other poster suggested. We'll see...

Hi,

What do you mean by subclassing? Inheritance?

There shouldn't be a problem inheriting a windows forms control (that
is inheritable).

Moty- Hide quoted text -

- Show quoted text -
I think I found the issue. In my inherited Button control I had a
couple of boolean fields that I made public through properties. When I
excluded using these then the control dropped into my main form fine.
When I included these into the inherited button control again then the
action made VS disappear. Definitely a bug. My Visual C# 2005 Express
IDE didn't care one way or the other. But I am working fine now.
Instead of using a boolean true/false I just zero out the integer
value I'm referring to...

Jun 6 '07 #6

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

Similar topics

12
by: christopherlmarshall | last post by:
Suppose you want to write a subclass of some existing class you are importing from a module you didn't write and that you don't want to study the internals of, and you want to define a data member...
1
by: Carlos Lozano | last post by:
Hello, I have a class CustomButton that derives from System.Windows.Forms.Control to create a button showing a picture. I would like it to behave as a real button derived from...
9
by: Ken Varn | last post by:
Is there anyway to override a public virtual method or property so that it is private in my derived class? I tried using new on the property and making it private, but no luck. --...
9
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't...
2
by: DotNetShadow | last post by:
Hi Guys, I'm trying to work out how events work in VB.NET Basically I want to create a base class that has an Event. I would like all derived classes to inherit this event. I sorta worked out...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
3
by: Rob | last post by:
I have these classes (elided methods): class Base { public: Base(string name) {...} }; class Derived : public Base {
6
by: Bhawna | last post by:
I am into c++ code maintenance for last 3-4 years but recently I am put into design phase of a new project. Being a small comapany I dont have enough guidance from seniors. Currently I am into a...
10
by: blangela | last post by:
If I pass a base class object by reference (likely does not make a difference here that it is passed by reference) as a parameter to a derived class member function, the member function is not...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...

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.