|
-
Feb 5th, 2006, 02:28 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Form2 does not get focus
Greetings
I am a VB6 programmer as well as of VB.NET
I can easily unload (close) a form and open other in VB6 but in .NET it seems a little tricky
I however have done that but
When my other form opens it is not focused
I tried to find get focus property but could not find it, I have also tried to close the first form but then the whole application is closed.
I also try to use hiding the object the code of hiding is correct as it shows no error but the form does not hide and I have to explicitly focus on other form
Public Class Form1
Inherits System.Windows.Forms.Form
Dim x As New Form2
Dim y as New Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
x.Show()
y.hide()
End Sub
I have also used 'Me' keyword but in vain.
Q1. How do I get focus on the other form?
Q2. How can I close form1 without closing whole application?
Awaiting your reply and thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|