VB Controls In VB2005

B

bz

the vb.upgrade group is dead. I think I will post this here instead.

Hi,

I ran the Upgrade Wizard to upgrade my VB6 project to VB2005 Express
Edition.
I got 140 errors and 170 warnings.

One of the error was that it wouldn't load a VB6 control.

(In VB6, if it can't load a control, VB6 will replace it with a PictureBox.)

But VB2005 didn't do that. It wouldn't even let me display the form at all
for me to delete that control.

Any idea how to display the design view to replace that control?

Thanks!




--
There is no answer.
There has not been an answer.
There will not be an answer.
That IS the answer!
And I am screwed.
Deadline was due yesterday.

There is no point to life.
THAT IS THE POINT.
And we are screwed.
We will run out of oil soon.

http://spaces.msn.com/bzDaCat
 
R

rowe_newsgroups

You could find the InitializeComponent sub for the form (the one marked
"do not edit this with the code editor") and delete all references to
that control. Then when design view refreshes the control should be
gone.

Thanks,

Seth Rowe
 
T

Tim Patrick

I had a similar problem with a third party control that wouldn't convert
over. The Upgrade Wizard semi-converted the code to the point where the designer
wouldn't load. My solution (assuming the form was named "Form1") was to open
the Form1.Designer.vb file, and hand-edit the code to remove the control
in question. Then I was able to open the designer and add in the substitute
control visually.

To view the designer file, click on the "Show All Files" toolbar button that
appears at the top of the Solution Explorer panel. Then expand the "plus
sign" next to the form you are having trouble with. You should see the Designer
and the RESX files for that form. Double-click on the Designer file to edit
it; it's just a normal VB class file. Locate any lines that have to do with
your control and delete those lines (although you may want to take notes
on the property values before you delete them all).
 
B

bz

Thanks!!!

Oh crap! That control is a container... now all my buttons are gone!!
aaaahahaha! huhhhooo... <G>
 
B

bz

Thanks!

I changed the codes but it still didn't want to load. I clicked "refresh"
but nothing happened.

So, I saved and restarted the IDE.

Do I have to do this everytime I change the codes in the Designer?
 
T

Tim Patrick

You can get the buttons back by adding them directly to the form instead
of to the deleted control. You probably had lines in the Designer file that
looked like this.

Me.TheBadControl.Controls.Add(Me.SomeButtonControl)

Just change this to:

Me.Controls.Add(Me.SomeButtonControl)

That will glue the button directly to the form.

As for your other message about the form still not displaying, please post
the error message that appears. And I wasn't sure what you meant by clicking
"refresh" in Visual Studio.
 
B

bz

Yes, I figured it out how to add the controls... I was a Java guy before...
This VB.NET thing kinda mimic the Java thing from Sun.

Ok... (so please excuse me... I am new...) I changed the codes in the
Form1.Designer.vb file to "comment" out all the reference to that bad
control. I then double clicked the Form1.vb file to display the form. It
didn't work. It didn't refresh/parse the new codes (I guess). There was a
little button under the "Solution Explorer" that said "Refresh". I clicked
that and then double clicked the Form1.vb file again. Nothing. It still
said I had a bad control on the form. So, I saved and restarted the IDE.
Now it re-parse/refreshed the form.
 
T

Tim Patrick

I'm not sure, then. I do the type of change that you are doing all the time.
After I change the Designer file, I always do a "File / Save" command to
make sure Visual Studio knows I am serious. Then I re-open the visual designer,
and all my changes are there.
 
B

bz

I am trying this out with the free VB2005 Express Edition.
So, it may be different from the paid version... I guess.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top