473,322 Members | 1,846 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,322 software developers and data experts.

Changing control name

Ant
Hi, I'm a Vb6 developer just getting into .Net & I like it!
But...

How do I change the name of a control, say, a button, once code has been
written to it. Even if I delete the old event, whenever I click on the newly
named control, it brings me to the old controls click event. i found that if
i manually change the event name to the new name, it works. Is this the best
or only way of changing a controls name, by manually changing the event name
as well?

thanks for your input
Ant
Jul 21 '05 #1
4 1502
Ant.

Assuming that you use the IDE and change your name in the designer part by
right clicking on the control, than everything should go automaticly. If you
change things in the code, than you have to do everything by hand.

What not does change even using the designer is

Sub Button1_Click (bla bla) handles me.MyEndButton.

That Button1_Click name does mostly nothing and when you need to use that,
than you have to do that with hand. (You would not be glad if it was
changing and you was calling the procedure from another sub).

I hope this helps,

Cor
Jul 21 '05 #2
Ant
Hi Cor,
Thanks for your reply. You are right. When I change the name with the
properties window, the code in the original event still fires ok. If I decide
to rename the event to correspond to the controls new name however, I get a
build error. Do I need to do something additionally when I rename the event
to match the control?

Thanks for your help
Ant

"Cor Ligthert" wrote:
Ant.

Assuming that you use the IDE and change your name in the designer part by
right clicking on the control, than everything should go automaticly. If you
change things in the code, than you have to do everything by hand.

What not does change even using the designer is

Sub Button1_Click (bla bla) handles me.MyEndButton.

That Button1_Click name does mostly nothing and when you need to use that,
than you have to do that with hand. (You would not be glad if it was
changing and you was calling the procedure from another sub).

I hope this helps,

Cor

Jul 21 '05 #3
Ant,
Thanks for your reply. You are right. When I change the name with the
properties window, the code in the original event still fires ok. If I
decide
to rename the event to correspond to the controls new name however, I get
a
build error. Do I need to do something additionally when I rename the
event
to match the control?


No forgive me how I write it, you should do than something stupid or have
used that name that you changed already somewhere else. As I wrote in my
previous message.

Cor
Jul 21 '05 #4
Ant
Thank you
Ant

"Cor Ligthert" wrote:
Ant,
Thanks for your reply. You are right. When I change the name with the
properties window, the code in the original event still fires ok. If I
decide
to rename the event to correspond to the controls new name however, I get
a
build error. Do I need to do something additionally when I rename the
event
to match the control?


No forgive me how I write it, you should do than something stupid or have
used that name that you changed already somewhere else. As I wrote in my
previous message.

Cor

Jul 21 '05 #5

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

Similar topics

3
by: Cengiz Ulku | last post by:
Hi all, I know now how to change the font name of a RTF file in a RTB control using, for example: RTextBox1.SelFontName = cmbFonts.Text I have a RTF file -created with Word- displayed in a...
5
by: David | last post by:
Hi I seem to be getting nowhere with this. I am opening a form which will be used to input Notes into different fields in a table. My problem is changing the unbound field name to the field name...
3
by: John | last post by:
I have an asp.net control which on the first Load of the page has a unique ID something like: _ctl0__ctl1_GroupName__ctl1_ControlName and after the first postback it changes to: ...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
4
by: Ant | last post by:
Hi, I'm a Vb6 developer just getting into .Net & I like it! But... How do I change the name of a control, say, a button, once code has been written to it. Even if I delete the old event,...
4
by: andychambers2002 | last post by:
I'm working on a "TempFile" class that stores the data in memory until it gets larger than a specified threshold (as per PEP 42). Whilst trying to implement it, I've come across some strange...
1
by: Blasting Cap | last post by:
I am having trouble changing the font for a PushButton control in a datagrid button column. I have seen several posts refer to styles and simple changes to the HTML for font changes but most of...
3
by: dcassar | last post by:
I am working on a complex server control that dynamically creates an HtmlInputHidden control that stores its value. As far as the postback process is concerned, this hidden input acts as the...
8
by: mike_solomon | last post by:
I have a button <input type="submit" name="Delete" value="Delete"> This code can not be changed I want to use Javascript to change the type I tried:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.