Hi i have a form1 and form2 and also a button1

in my button1 i have this code


now when the Form2 is show and everytime i click a button

    Private Sub Combo_AM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)_
    Handles Combo_AM.SelectedIndexChanged

    With Combo_AM

        If Combo_EBU.Text = "EBU 2" Then

            If .Text = TonetteA Then
            ElseIf .Text = JennyT Then
            ElseIf .Text = MaricrisB Then
            ElseIf .Text = NellieR Then
            End If

the Form2 lost its focus
is their a way to do this stuff?
like i put something like


Recommended Answers

All 4 Replies

if there is any control on form2 , you can just set focus to that control on the load event of your form 2. like


Hope this helps you.

it is still behide form1

...now when the Form2 is show and everytime i click a button the Form2 lost its focus

I have to ask, which Form parents the buttons that you are clicking? If they are on Form1, this is normal as they have to be in focus to be clicked.

Also, does the combobox handler code you posted have any relavence?
Is it on Form1 or Form2?

Try setting the window parent of form2.

'Place a statement to check and launch.
'The check is to safeguard from InvalidOperation Exceptions.

If Form2.Visible = False Then Form2.Show(Me)

'A simple call like:
'Will then focus the control desired.
Be a part of the DaniWeb community

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