Modal forms and notification box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claire

    Modal forms and notification box

    Hi,
    I've a problem.
    Our app has a main screen, a user logs in to the system using a smart card.
    After login, several loops through a switch statement are performed to check
    for certain conditions. One or more screens may be shown modally in
    succession, finally ending in the user's work centre.The user is usually
    encouraged to pull their card before reaching the work centre as this is
    primarily a terminal (no keyboard/mouse) for logging in at reception.
    I've been asked to add a notification to show the user that they have new
    mail (one of the modules in the application) that they can see in the stages
    prior to them hitting their work centre.
    I thought of creating a small Topmost = true, non modal form that sits in
    one of the corners of the screen. This works fine for displaying an alert,
    but now the customer wants it clickable so that the user can skip screens
    straight to their inbox.
    The thought of trying to convert the main modal forms into non modal (yet
    make them behave modally) is giving me nightmares, I can imagine the code
    will become really messy and become unreliable.
    Has anyone else come up against this? how did u overcome it?
    I did think that my app could maybe run a small 2nd application just for
    this screen, but I dont know if there'd be any security issues of one app
    starting another with the OS. I've also not tried doing this so Im not sure
    how easy it is to monitor and receive results from another app.

    many thanks
    Claire


  • Marc Gravell

    #2
    Re: Modal forms and notification box

    Not sure how good an idea this is, but perhaps show the second form on a
    separate thread? You'd need to think about how they talk to eachother (and
    sync), but it seems to work...

    Like I say, this might be madness... you'd need to test it...

    Marc

    static void Main()
    {
    Application.Ena bleVisualStyles ();
    using (Form mainForm = new Form())
    using (Button btn = new Button())
    {
    mainForm.Contro ls.Add(btn);
    btn.Text = "Pretend they're now logged in";
    btn.Click += delegate
    {
    btn.Enabled = false; // only once ;-p
    StartWhatever() ;
    };
    Application.Run (mainForm);
    }
    }
    static void StartWhatever()
    {
    Thread thd = new Thread(ShowEmai l);
    thd.Name = "Email";
    thd.IsBackgroun d = true;
    thd.Start();
    }
    static void ShowEmail()
    {
    using (Form f = new Form())
    {
    Application.Run (f);
    }
    }


    Comment

    Working...