473,405 Members | 2,282 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,405 software developers and data experts.

Change the control class at runtime

I have a label on my form, but at runtime I would like to change it to a
LinkLabel. Is it possible to change the class of that label control at
runtime after the window is open? Is this possible?

Please advise.

Thanks
Nov 17 '05 #1
2 3066
Hi ,

of course, like this:

LinkLabel ll = new LinkLabel();

ll.Left = label.Left;
ll.Top = label.Top ;
.......

this.Controls.Add ( ll );

label.Visible = false;
ll.Visible = true;

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"kaumil" <ka****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
I have a label on my form, but at runtime I would like to change it to a
LinkLabel. Is it possible to change the class of that label control at
runtime after the window is open? Is this possible?

Please advise.

Thanks

Nov 17 '05 #2
Hi ,

of course, like this:

LinkLabel ll = new LinkLabel();

ll.Left = label.Left;
ll.Top = label.Top ;
.......

this.Controls.Add ( ll );

label.Visible = false;
ll.Visible = true;

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"kaumil" <ka****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
I have a label on my form, but at runtime I would like to change it to a
LinkLabel. Is it possible to change the class of that label control at
runtime after the window is open? Is this possible?

Please advise.

Thanks

Nov 17 '05 #3

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

Similar topics

3
by: | last post by:
Hi,all I want to change Control's size&location in runtime ,(C#) but i dont know how to do! :(so, can you provide me with document about this. my email: zhonghua@rinpak.com.cn ...
0
by: kaumil | last post by:
I have a label on my form, but at runtime I would like to change it to a LinkLabel. Is it possible to change the class of that label control at runtime after the window is open? Is this possible? ...
0
by: Tom | last post by:
I am developing a page that will contain multiple instances of a Composite Custom Control that i have developed. The problem is that the user will determine at run time how many of the control...
3
by: Sky Sigal | last post by:
I coming unglued... really need some help. 3 days chasing my tail all over MSDN's documentation ...and I'm getting nowhere. I have a problem with TypeConverters and storage of expandableobjects...
1
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one...
3
by: RG | last post by:
For a Windows project in VB.NET 2003: I need a Calendar that’s much larger than the MonthCalendar control in the toolbox; it needs to fill the whole screen (at least approximately ). VB...
3
by: Andy | last post by:
If I use Visual Studio.Net 2003 to generate "web references" for clients using either sproxy.exe (for C++) client or wsdl.exe (for C#) clients, the web service endpoint gets "baked" into the...
8
by: Radek Budař | last post by:
Hi all, i have trouble with changing text value of textbox on runtime. I use this control to display process information about sending e-mail per smtp. I use external component >>Imports...
7
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.