Results 1 to 7 of 7

Thread: best way to move "dialog box"

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    best way to move "dialog box"

    hi guys! is there any better way to make my "dialog box" move with out making the controls in that "dialog box", like Textbox, label, etc..appears as black while the "dialog box" is moving like the screenshot below. Thanks in advance!!
    Attached Images Attached Images  

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: best way to move "dialog box"

    What precise effect are you trying to achieve and what code are you using at the moment?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: best way to move "dialog box"

    What i want to achieve is to make the texts on that "dialog box" appear instead of the black boxes while moving. Because as you can notice the texts on my "dialog box" is not display until the "dialog box" stops.
    My code for showing my "dialog Box"
    Code:
            public struct Alarm_data
            {
                public string EvntTitle;
                public string EvntDate;
                public string EvntLocation;
            }
    
            public void show_Alarm_notification(string ArgEvntTitle, string ArgEvntDate, string ArgEvntLocation)
            {
                try
                {
                    int notification_y_coor;
                    Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;
    
                    Alarm_data EvntData = new Alarm_data();
                    EvntData.EvntTitle = ArgEvntTitle;
                    EvntData.EvntDate = ArgEvntDate;
                    EvntData.EvntLocation = ArgEvntLocation;
                    SoundPlayer sndAlarm = new SoundPlayer();
                    Notification Notification_frm = new Notification();
                    Notification_frm.ParentData = EvntData;
                    Notification_frm.TopMost = true;
                    Notification_frm.StartPosition = FormStartPosition.Manual;
                    notification_y_coor = workingArea.Height;
                    //workingArea.Height - Notification_frm.Height;
                    //MessageBox.Show("TITLE: " + EvntTitle + " Date: " + EvntDate + " Location: " + EvntLocation);
                    Notification_frm.Show();
                    for (int x = 0; x <= Notification_frm.Height; x++)
                    {
                        Notification_frm.Location = new Point(workingArea.Width - Notification_frm.Width, workingArea.Height - x);
                    }
    
                    if (File.Exists(txtSettingSoundFile.Text))
                    {
                        sndAlarm.SoundLocation = txtSettingSoundFile.Text;
                    }
                    else
                    {
                        sndAlarm.Stream = Properties.Resources.WARNING;
                    }
                    sndAlarm.Play();
                }
                catch (Exception ex)
                {
                    show_error_message("show_Alarm_notification", ex.Message);
                }
            }

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: best way to move "dialog box"

    I know that you want the controls to display. You already said that. I meant what type of effect are you trying to accomplish by moving the form? Is this supposed to be a notification window that sildes up from the system tray area, i.e. a so-called "toast" window? Is it supposed to be something else? Is this effect only to be seen when the form is first displayed or the whole time the form is visible? As I said, what effect are you trying to achieve?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: best way to move "dialog box"

    Sorry i dont get your previous post..anyway, yah! i want it to be something like "toast" which slides up from the system tray.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: best way to move "dialog box"

    Then you should use the AnimateWindow API. I have posted code in the VB.NET CodeBank that uses it to create a toast form. If you need help with transalation post back.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: best way to move "dialog box"

    thanks for that..maybe i'll just first try to understand it i'll just ask you if there is something i cannot understand. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width