|
-
Sep 27th, 2012, 09:21 AM
#1
Thread Starter
Junior Member
[RESOLVED] CF 3.5 - Alternative to Shown event ?
Hi there, 
I'm developping an application for Pocket PC but I don't have the Shown event for a form.
During FORM_A loading, I check some values and sometimes I need to open FORM_B.
But FORM_B is opened before FORM_A, so I can't see it. And I don't want my users to click on a button to open FORM_B, I want this check to be automatically done by my program.
My solution would be to use FORM_A.Shown() event, but I don't get it.. Maybe because I'm programming for Smart Devices?
Is there any alternative, tricks to simulate it ?
Thank you
-
Sep 27th, 2012, 09:26 AM
#2
Re: CF 3.5 - Alternative to Shown event ?
The Shown event hasn't actually been supported from the beginning of .NET. It was only introduced in .NET 2.0 I think. Before that we had to use the Activated event and use our own Boolean flag to differentiate between the very first instance of that event, which occurs when it is first displayed, and any subsequent instances. You can do exactly the same.
-
Sep 27th, 2012, 10:48 AM
#3
Thread Starter
Junior Member
Re: CF 3.5 - Alternative to Shown event ?
Thank you for your answer and explanation,
I try to initialize a glob boolean variable to False during load event.
Then in validated event I did like :
Code:
Class FORM_A
{
Dim myVar as Boolean = False // I tried this the 1st time
sub FORM_Load().Load
{
myVar = False // I tried this the 2nd time
}
sub FORM_Activated().Activated
{
If myVar = False then
FORM_B.Show
myVar = True
End If
}
}
Nothing seems to happen... FORM_B doesn't show itself... I replace FORM_B.Show by a Msgbox and it popup many times before my app crashs.
-
Oct 3rd, 2012, 03:29 AM
#4
Thread Starter
Junior Member
Re: CF 3.5 - Alternative to Shown event ?
I think I've found a solution which seems to work.
To open a new form during the loading of an other form, I replace .Show() to .ShowDialog().
Tags for this Thread
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
|