|
-
May 13th, 2004, 10:36 AM
#1
Thread Starter
Junior Member
vb.net doesn't manage its form code
Is there an option in vb.net to force the form designer to delete the code behind a controls that are removed from a form?
Every time I modify a form significantly I'm left with a very large number of unreferenced control declarations. I find it such a pain to remove them all. I'm also quite upset that vb.net doesn't manage its form code for you. I have wasted a considerable amount of time modifying forms. In fact it is so much work sometimes that I just end up creating a new form and moving all the code over.
Thus far vb.net is very aggravating as a development tool. My team is strongly considering going back to VB6. We have wasted a considerable amount of time dealing with vb.net related issues. We have also found that it takes a considerable amount of time to develop a vb.net application properly.
Microsoft has created a complex development tool with a interface that is full of bugs. They haven't made things easy for the developer at all. In fact, they have increased the development time of all my projects.
-
May 13th, 2004, 10:55 AM
#2
VB6 is the same way. If I delete a control, I'm still left with all the code behind the events of the control.
Also, I haven't seen this behavior. Are you running a Beta copy of VS by any chance?
I find it hard to believe that VS really does have all these problems considering the number of people who do use it and with out issues.
TG
-
May 13th, 2004, 11:24 AM
#3
Thread Starter
Junior Member
ok try this.
1. place a button on a form in vb.net
2. create its event code by double clicking on it
3. delete the button
4. place a new button on the form with the same name as the previous button
5. now double click on the button and enter its event code for the click event.
you will end up two event subs
Button1_Click
Button1_Click_1
at least in vb6 you didn't have deal with that!
you will never be able to jump to Button1_Click from the designer again. It will not be linked to Button1 anymore. In fact, if you will have to delete the event code from the first button before you can have a control called Button1 that references Button1_Click
now imagine you are making a large number of changes to a form.
Just be sure to bill your client for all the extra time you spend
but that is just one example
Last edited by 00Kevin; May 13th, 2004 at 11:31 AM.
-
May 13th, 2004, 11:35 AM
#4
PowerPoster
Hi OOKevin
"Is there an option in vb.net to force the form designer to delete the code behind a controls that are removed from a form?"
No. But neither is ther in VB6. If you anticipate that you want to remove controls, put them into a separate region to facilitate future removal.
"I'm also quite upset that vb.net doesn't manage its form code for you. "
If this is a separate issue from the above, what do you mean?
"I have wasted a considerable amount of time modifying forms. In fact it is so much work sometimes that I just end up creating a new form and moving all the code over. "
I don't follow that at all
"Thus far vb.net is very aggravating as a development tool. My team is strongly considering going back to VB6. We have wasted a considerable amount of time dealing with vb.net related issues. We have also found that it takes a considerable amount of time to develop a vb.net application properly. "
Of course there is always a learning curve when an entirely new product is introduced (which is what VB.NET really is as compared with VB6). Your choice is either learn or stagnate.
"Microsoft has created a complex development tool with a interface that is full of bugs. They haven't made things easy for the developer at all. In fact, they have increased the development time of all my projects. "
"Full of Bugs!!!!!!" Come on. How many have you found? Until you have fully learned VB.NET and created your own pool of mini apps etc, of course you will take longer. (I can still write some programs much more quickly in dBaseIII Plus than either VB6 or VB.NET but that is no reason to stay with outdated technology.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 13th, 2004, 11:36 AM
#5
Lively Member
Re: vb.net doesn't manage its form code
Originally posted by 00Kevin
Thus far vb.net is very aggravating as a development tool. My team is strongly considering going back to VB6. We have wasted a considerable amount of time dealing with vb.net related issues. We have also found that it takes a considerable amount of time to develop a vb.net application properly.
Microsoft has created a complex development tool with a interface that is full of bugs. They haven't made things easy for the developer at all. In fact, they have increased the development time of all my projects.
I can tell your frustration has been building up for a while, and I'm guessing that the form designer feature, or lack thereof, might have been the last straw, but just relax. You can't really dive into VB.NET like you and your team have been trying to do, it's a slow migration process that requires you to figure out the VB.NET way to do all the things you used to do in VB6, and so much has changed. If you stop and look at the big picture though.. multithreading, true OO, ADO.NET, all that good stuff.. you will realize there's a bigger benefit to making the transition.
Either way, VB.NET 2003 has the form designer feature you want. I never have to edit the code for the controls I delete with the form designer, if I look at the code for the form, the code is gone. That IS what you're talking about isn't it?
Your post really hurts, man! You talk like that about my baby again and we're gonna have a problem.
KT
-
May 13th, 2004, 11:44 AM
#6
Originally posted by 00Kevin
you will never be able to jump to Button1_Click from the designer again. It will not be linked to Button1 anymore. In fact, if you will have to delete the event code from the first button before you can have a control called Button1 that references Button1_Click
Not true. I bet if you look at the old _click event (which really isn't an event any more, but a sub that handles an event) it looks just like a normal sub.
Look at the "new" event sub, there should be a "handles button1.click" on the end of the declaration. Copy that (or cut it rather) and paste it onto the end of the old sub. Then delete the new (still empty) sub.
BTY: you can still access the old sub just like any other normal sub in the procedures drop down of the code window.
I don't have VS.NET in front of me but at least with my experiences with at home, the above works for me.
TG
-
May 13th, 2004, 11:49 AM
#7
Lively Member
Originally posted by 00Kevin
ok try this.
1. place a button on a form in vb.net
2. create its event code by double clicking on it
3. delete the button
4. place a new button on the form with the same name as the previous button
5. now double click on the button and enter its event code for the click event.
you will end up two event subs
Button1_Click
Button1_Click_1
at least in vb6 you didn't have deal with that!
you will never be able to jump to Button1_Click from the designer again. It will not be linked to Button1 anymore. In fact, if you will have to delete the event code from the first button before you can have a control called Button1 that references Button1_Click
now imagine you are making a large number of changes to a form.
Just be sure to bill your client for all the extra time you spend
but that is just one example
Ok first I want to make sure you're aware that the older event stub isn't going to make a difference in your application at all just sitting there because it doesn't actually HANDLE anything. Button1_Click_1 is the one that has the "handles" command.
Now let's talk aesthetics. It's harder to code with garbage in your way, so here are a couple of suggestions:
1. Don't write event handling code until you're fairly certain the layout of your form is going to look the way it does.
2. If you have to delete older event stubs, collapse the entire form to make it easier. Then it's as simple as selecting one row (if you move your mouse far enough to the left on the screen you can do this in one click) and hitting delete to delete the entire stub.
3. If you really have to know, the fact that the event stubs are left behind is a FEATURE, not a lack thereof. Some people just wouldn't want the code in their event deleted when they delete a button, in case they decide to link that code to another button or control somewhere else on the form. I usually write good OO code where I don't need more than a couple of lines to handle events, but occasionally I don't feel like nesting objects further into the application's structure.
Good luck, man, let us know how it turns out! Sucks you had such a bad experience with .NET, I absolutely love it.
KT
-
May 13th, 2004, 06:54 PM
#8
PowerPoster
Hi 00Kevin,
Ref. your last post.
In the circumstances you describe there is absolutely no necessity to delete the first button. If you do arrive at a situation where you decide to delete controls but feel you might be putting them back on the form in the future but do not want your client to see them meanwhile, make them invisible.
Quite frankly, if you and your team use structured systems analysis and proper flow charts you will hardly ever encounter such a problem. If you approach your programming like a fifth grade mediocre student with an incompetent teacher, then you will run into the problem all the time. (No personal offence meant)
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 13th, 2004, 11:14 PM
#9
Lively Member
My opnions..
Hi,
I think you code VB.Net using you VB6 methods... declare everythings in the VB6 methods...
Do you ever follow the track of the VS.Net... goto the Microsoft site to find out more... You may don't know what purpose you use dot net...
Try this link and educate yourself....
http://msdn.microsoft.com/theshow/Archive.asp
http://msdn.microsoft.com/msdntv/archive.aspx
Last words.... change your mindset... before you start to do the dot net programming. like driving Manual and Auto, motor and bicycle..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|