Having difficulty with .Designer.vb Partial Class files

Pselus

New member
Joined
Apr 2, 2007
Messages
3
Programming Experience
1-3
My office FINALLY moved to VS 2005 on our huge project. I am trying to add a new UserControl to the Project and I'm having a TON of difficulty.
When I add the new UserControl, VS automatically adds the Partial Class with the .Designer.vb extension. I already have the UI for this UserControl built, so I first tried copying and pasting the controls onto the new UserControl. They show up in the Designer, but when my control is viewed in the program, nothing shows up.
If I manually add the code for the controls in my UserControl's .Designer.vb file, they show up when the program is run, but not when I hit "View Designer" withing Visual Studio. On top of that, in the UserControls code, I can't access the controls. Meaning, I can't call TextBox1.Text or anything like that.
If I add the code for the controls to both the .Designer.vb file and the .vb file, I can view the controls at Designtime and Runtime, but any code I use in the .vb file to change a control does not affect what is displayed on screen at Runtime.

I finally got around the problem by manually copying an existing UserControl (that was created before we used VS 2005) and adding it to the project, then changing the name of it to what I needed and pasting the new UI onto it, but I don't want to have to do that every time I need a new UserControl so I was hoping someone could explain to me what I'm doing wrong or if this is a common problem.
 
When I moved from VS 2003 to 2005, I noticed right off the bat that I couldn't just copy & paste controls from the old program to the new one. What I ended up doing was manually remaking the window then in code I copied and pasted the code and of course modified the code to use the new features.

I couldn't tell you why you're getting those problems for a UserControl
 
Back
Top