Forms VB 6.0 vs. .Net

  • Thread starter Thread starter Carey
  • Start date Start date
C

Carey

OK, I am sure this has been answered a million time, bit
I am new to VB.Net.

I have an app, with 4 forms. In VB 6, I would "Simply"
put a .Show command behind a command button to make the
other form appear. All I see for new documentation is the
reference similar to:

Dim xForm as New Form
xForm.ShowDialog()

I do not want a new form created from scratch, I want to
use my forms with the controls already placed onto them.
Any help would be GREATLY" appreciated.
 
OK, any sample code you could suggest???

-----Original Message-----
In .Net, all forms are just special types of classes.
Whenever you want to use a form, you must instantiate an
instance of that form 'class'. However, you design the
form just like VB6, by dragging and dropping controls onto
the form surface. When you create a 'new' form, the form
will have all of the controls, events, etc. that you
designed into it. The 'new' syntax is just an artifact of
the object-oriented nature of the .Net Framework.


.
 
You already have all the code you need. :-)

Let's assume you've designed a form and named it 'MyForm'. In VB6, you
probably displayed the form this way via a 'Click' event...

MyForm.Show(vbModal)

However, you also *could* have coded it this way in VB6...

Dim theForm As New MyForm
theForm.Show(vbModal)

In VB.NET, you simply do it this way...

Dim theForm As New MyForm
theForm.ShowDialog()

- Mark
 
Back
Top