Hi All,

Please help me..i wanted to transfer control to a different form when one form is minimized..,how do i achieve this?vb.net...please help

You might be able to use the WindowState to enable the second form.
Just check to see if the current forms new WindowState is Minimized.

Private Sub Form_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
        If Me.WindowState = FormWindowState.Minimized Then
            'Create or transfer control to second form
        End If
    End Sub

Hi,'
Thanks for the reply.. but how do i transfer control to another form.,? im nw new to vb.,pls help me out.,thank you

Well. It depends on your definition of control.

Let's say for instance that you fill out some information on the first form, and wish to transfer some of it to the next form.
You could put that information into an ArrayList and use that as an argument in the second forms constructor.

'First form
Private Sub Form_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
    If Me.WindowState = FormWindowState.Minimized Then
        Dim data As New ArrayList
        data.Add(<some text>)
        data.Add(<some number>)
        'and so on...

        Dim frm As New secondForm(data)
        frm.Show()
    End If
End Sub

'Second form
Private incomingData As ArrayList

Public Sub New()
   Initialize Component()
End Sub

Public Sub New(data As ArrayList)
   InitializeComponent()
   incomingData = data
End Sub

Private Sub secondForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
   'Do something with the data in the ArrayList, incomingData
End Sub

This is just one way of transferring "control".

yeha got it now,thanks alot for ur help..:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.