PDA

View Full Version : I need help with forms..


tazaramya
03-11-04, 02:05 AM
ok! This is what I wan to do.....

I have
frmToolKit (which is my main form)
it has an image and a RadioButtonList (called radOption)
then a HR

Under the HR I would like to show a different form based on the
radio button pressed. Example:

if radOption.SelectedIndex = 0 Then
frmLogFa.Show (or something like that)
end if

I'm not sure if this will work but how do I tell it to display on my main form?
kinda like frames but not really.

HELP!!!

TLWallace
03-16-04, 01:06 PM
ok! This is what I wan to do.....

I have
frmToolKit (which is my main form)
it has an image and a RadioButtonList (called radOption)
then a HR

Under the HR I would like to show a different form based on the
radio button pressed. Example:

if radOption.SelectedIndex = 0 Then
frmLogFa.Show (or something like that)
end if

I'm not sure if this will work but how do I tell it to display on my main form?
kinda like frames but not really.

HELP!!!
Here is one way to do subforms in VB.NET

==================[FrmMain]============
Private m_FrmSubForm AsNew FrmToolKit

Private m_RefSubFormIndex AsInteger

Private IsInitializing AsBoolean

PublicSubNew()

MyBase.New()

IsInitializing = True

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

IsInitializing = False

EndSub

PrivateSub radOption_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radOption.CheckedChanged

If IsInitializing ThenExitSub 'Get out if you're intializing this form

Me.Panel1.Controls.Add(m_FrmSubForm)

m_FrmSubForm.Show()

'Set the index of this control

m_RefSubFormIndex = Me.Panel1.Controls.GetChildIndex(m_FrmSubForm)

EndSub
====================[end FrmMain]=================

==================[FrmToolKit]============
PublicSubNew()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

Me.SetTopLevel(False)

EndSub


=================[end FrmToolKit]==========

tazaramya
03-16-04, 09:52 PM
Thanks for your example. I don't have a FrmMain should I create this?

Susan