473,480 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Smooth transition between forms - ShowDialog and hide parent

Hello,

My application has a series of forms that open using ShowDialog() on
top of their parent as the user drills down to enter increasingly more
detail regarding data. I want to hide the previous form so that the
user can minimize or move the current form without others behind it.

Currently I am using this code;

\\
Private Sub btnJobForm(ByVal......
Dim f As New f010Jobs
Me.Visible = False
f.ShowDialog()
Me.Visible = True
End Sub
//

However there is a cosmetic drawback to this. The first form disappears
before the new form fully paints. The affect is unprofessional.

On return everything looks fine.

I don't know how to make the form disappear later unless the new form
tells its parent to disappear, but I don't know how to do that either.

What are my options? What is the best way to resolve this problem?

Thank you,
dbuchanan

Nov 21 '05 #1
2 11380
Hi there,

One thing you could do is pass the previous form as an object to the
next form on initialization. Then when the "Activate" event fires in the
next form, this is your time to call the "Hide" method of the previous form.

1. Initialize form (next) passing current form to constructor
2. Call ShowDialog of (next)
3. In Active event of (next) form call Hide on form passed during
construction, making sure you raise a static boolean within the active event
handler to prevent hiding every time the form is activated as you only want
this to happen once.

Just an idea anyway, not actually tried it, but in theory it should
work.

Nick.

"dbuchanan" <db*********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hello,

My application has a series of forms that open using ShowDialog() on
top of their parent as the user drills down to enter increasingly more
detail regarding data. I want to hide the previous form so that the
user can minimize or move the current form without others behind it.

Currently I am using this code;

\\
Private Sub btnJobForm(ByVal......
Dim f As New f010Jobs
Me.Visible = False
f.ShowDialog()
Me.Visible = True
End Sub
//

However there is a cosmetic drawback to this. The first form disappears
before the new form fully paints. The affect is unprofessional.

On return everything looks fine.

I don't know how to make the form disappear later unless the new form
tells its parent to disappear, but I don't know how to do that either.

What are my options? What is the best way to resolve this problem?

Thank you,
dbuchanan

Nov 21 '05 #2
dbuchanan wrote:
Hello,

My application has a series of forms that open using ShowDialog() on
top of their parent as the user drills down to enter increasingly more
detail regarding data. I want to hide the previous form so that the
user can minimize or move the current form without others behind it.

Currently I am using this code;

\\
Private Sub btnJobForm(ByVal......
Dim f As New f010Jobs
Me.Visible = False
f.ShowDialog()
Me.Visible = True
End Sub
//

However there is a cosmetic drawback to this. The first form disappears
before the new form fully paints. The affect is unprofessional.

On return everything looks fine.

I don't know how to make the form disappear later unless the new form
tells its parent to disappear, but I don't know how to do that either.

What are my options? What is the best way to resolve this problem?

Thank you,
dbuchanan


Haven't done this, but should work...

In you subforms do something like:
sub Form_Load Event
addhandler Me.Activated, addressof ActivatedSub
end Sub

sub ActivatedSub
directcast(Me.Parent, MainFormType).Visble = false
removehandler me.activated, addressof ActivatedSub
end sub

Activated only fires once the form is ready to display. I remove the
handler to stop it from repeatedly calling the code every time you
alt-tab back to the form. Not sure if parent gets set automatically
when you call showdialog, you may need to set it before calling showdialog.

Chris
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1509
by: Gwyn | last post by:
I have a burning desire (need) to dislay either modal forms or something equivalent within an MDI based application... Except I can't! I can use ShowDialog() but the form being shown cannot...
1
385
by: Don | last post by:
hi in the past (vb 5.0) is used to create applications with multiple forms. i would hide and/or show the appropriate form depending on user input. now i'm using vb.net (still getting used to it)...
0
2285
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
2
4467
by: Guest | last post by:
Hi, I am writing a Jeopardy-like game that contains three forms. One is the Jeopardy board, another is the Question/Answer displayer, and the last is the scoreboard. I need to find a way to...
5
3550
by: Dmitry Akselrod | last post by:
Hi Everyone, I am working in VB.NET, Framework v.1.0. I have tons of forms in my application. I have a situation, where a form starts another form as a Modal Dialog. The Modal Dialog then...
4
1931
by: henpat | last post by:
Hello all I have a MDI Parent Form with some childs. I need to know how can I setup a child form in order to disable access for other forms "in the back". I need that only the active form be...
8
36056
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
2
241
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I want to have 3 forms open modally. They are 1: a background form (bgform); 2: form_x; 3: loginform. bgform is always open. form_x could be any random form that that bgform has shown modally....
21
3281
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
6904
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...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6895
tracyyun
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...
1
4770
isladogs
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...
0
4476
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...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.