Hi
I have a form called Form1. When Form1 loads, another form, Form2, will appear. However, i want Form2 to appear in front of Form1. I tried doing the following but it doesn't seem to work. Form 2 still appear behind Form1. - Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
-
Form2.Show()
-
Form2.BringToFront()
-
-
End Sub
7 1182
Question moved to .NET Forum.
Hi
I have a form called Form1. When Form1 loads, another form, Form2, will appear. However, i want Form2 to appear in front of Form1. I tried doing the following but it doesn't seem to work. Form 2 still appear behind Form1. - Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
-
Form2.Show()
-
Form2.BringToFront()
-
-
End Sub
This appears to work on my system... - Public Class Form1
-
Private Sub Loaded(ByVal sender As Object, ByVal e As System.EventArgs) _
-
Handles MyBase.Load
-
Dim oFrm As Form = New Form2
-
oFrm.Show(Me)
-
End Sub
-
End Class
Then in your splash screen (I'm assuming that's what you're using it for), you can have a timer to auto-close it after a period.
This appears to work on my system... - Public Class Form1
-
Private Sub Loaded(ByVal sender As Object, ByVal e As System.EventArgs) _
-
Handles MyBase.Load
-
Dim oFrm As Form = New Form2
-
oFrm.Show(Me)
-
End Sub
-
End Class
Then in your splash screen (I'm assuming that's what you're using it for), you can have a timer to auto-close it after a period.
The code works, thanks. However, i have some problem with focusing it. Even though my Form2 appears in front of my Form1, the form is grayed. I need to click on the form, then the focus is on the textbox in the form. I tried 'Form2.nameText Box.Focus()' in the load event but it doesnt work. How do i make the focus go to text box once Form2 loads?
could you try on form2 load just textbox.focus?
could you try on form2 load just textbox.focus?
I tried but it doesn't work. I also put it in my Form1 but still, the textbox is not focused.
Could you please confirm that the Enabled Property of Form2 is set to true?
Could you please confirm that the Enabled Property of Form2 is set to true?
It's already set to true. I've already managed to solve it. Thanks. I used oFrm.ShowDialog (Me) instead and it works.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Cornford |
last post by:
I am interested in hearing opinions on the semantic meaning of FORM
(elements) in HTML.
I have to start of apologising because this question arose in a context
that is not applicable to the Internet. Specifically, marking up a
document that will contain multiple related form controls (intended
exclusively for client-side scripting) that would never be intended to
be submitted. I realise that that concept is a non-starter in an
Internet...
|
by: Howard Jess |
last post by:
Apparently, form elements of type
<input type="image" src="...>
are not included in the form's elements collection.
I don't understand why not; according to DOM2, all form control
elements in the form are part of the elements collection. Further,
this element doesn't appear in the (DOM0) document.images
collection either; so it's really not well-accounted for.
|
by: Steve |
last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's
criteria is set ats:
Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the
selections are 30, 60 and 90. The default is set at 30.
Question1: When the form opens, there are no records displayed although there
are many records that fit the criteria of 30. If I put a button on the form to
do a requery and press the button, all the records...
|
by: Daniel R. Rossnagel |
last post by:
As I can hide the bar of I title of a window daughter maximized within form
MDI Already I have proven with different types from borders, hiding
thebuttons to maximize, to diminish and control box, but nothing... If
somebody can help me I'm thanked
Daniel R. Rossnagel
|
by: TyBreaker |
last post by:
I have a form where when you click on a button a new form appears.
However the controls on the new form appear as blanked out regions on
the form until I click on them and suddenly they appear. I haven't seen
this before but am a bit of a newbie with VB 2005 so does anybody know
why this is happening?
--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_,...
| |
by: mohit.akl |
last post by:
Hey guys & gals
I am havng trouble modifying the control box. I want to make the
maximise button invisible and have minimisise button instead of it.
Like this _ X (not like _ o X )
How to do this... and eventually i want to modify the control box in
the form of ? _ X ... I.e. adding a new button to control box. I need
to detect the click events.
|
by: deephill |
last post by:
hi
i need form dependency.
Can u check below code?
<p>1. Are you married?</p>
<p>
|
by: Zytan |
last post by:
I have created a new form from the main form. When I close the main
form with the 'x' close button, its Form.FormClosed event is run, but
not the dialog's.
Is this normal? It is ok / dangerous? How can I force shutdown code
within the dialog's Form.FormClosed event run?
Zytan
|
by: Rob |
last post by:
Let's say you open Form1 that contains TabControl1
There are several tabs on TabControl1
Now you open a new Form2 that contains a User Control
How can you determine the Selected tab in Form1 from the User Control in
Form2 ?
Hope this is clear enough...
|
by: Susan Bricker |
last post by:
Hi. I am stumped. I have a form that when opened via logic (VBA
OpenForm) the screen appears to flash but the form does not appear.
I've traced and it certainly goes to the form's module and the Form_Open
and Form_Load routines...but it doesn't appear.
I've looked around at the attributes of the form, at the attributes of
the other forms opened in the background but I can't figure it out.
I even went so far as to force the other...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |