C# .NET - Popup in windows application - Asked By Sagar P on 29-Aug-08 02:08 AM

Hello All,

I want to develope a popup window for my application. I want a popup same like our meesanger popup like windows messanger, gtalk etc, which will come from right bottom corner.

I want it in c# windows application.

Say on button click i want to show that popup.

Can you help me.

Thanks in advance.

Sujit.

Use notifyIcon - Kalit Sikka replied to Sagar P on 29-Aug-08 02:12 AM

Button_Click

notifyIcon1.Visible = true;

this.notifyIcon1.BalloonTipText = "FTP Info: " + strSplitOutput + iFolderValue + " Produced";

this.notifyIcon1.ShowBalloonTip(5);

Try  this in button click

 

can't chage behaviour of messagesbox - Web Star replied to Sagar P on 29-Aug-08 02:13 AM

You can not change windows messagebox behaviour, but you can display customized messageby creating your own messagebox form. Write whatever properties you want to have on your messagebox write ShowMessageBox method on the form and display it by setting properties

Use this - Kalit Sikka replied to Sagar P on 29-Aug-08 02:15 AM

private void Form1_Move(object sender, EventArgs e)
{
  //This code causes the form to not show up on the task bar only in the tray.
  //NOTE there is now a form property that will allow you to keep the 
  //application from every showing up in the task bar.
  if (this == null)
  { //This happen on create.
    return;
  }
  //If we are minimizing the form then hide it so it doesn't show up on the 
  //task bar
  if (this.WindowState == FormWindowState.Minimized)
  {
    this.Hide();
    notifyIcon1.ShowBalloonTip(3000, "Test App",
            "The App has be moved to the tray.",
            ToolTipIcon.Info);
  }
  else
  {//any other windows state show it.
    this.Show();
  }

}
create the object of that form , frm.show(); - Deepak Ghule replied to Sagar P on 29-Aug-08 02:17 AM

create the object of that form
e.g

frmPopup frm = new frmPopup();
frm.show();

U can give left , top , width ,height property to that page
usign frm object

set it (left , top , width ,height property ) appropriate to look it like popup.

use balloon popup - Web Star replied to Sagar P on 29-Aug-08 02:20 AM
NotifyIcon control is supposed to pop up a text filled balloon when this code runs.
 
'Show the icon
NotifyIcon1.Visible = True
'Show the balloon...any day now...wait for it...
NotifyIcon1.ShowBalloonTip(3000, "Test", "Testing...", ToolTipIcon.Info)
Link... - Atul Shinde replied to Sagar P on 29-Aug-08 02:21 AM

Links:

http://www.codeproject.com/KB/scripting/myalerts.aspx (Best link)

http://www.codeproject.com/KB/cs/NotifyChecker.aspx

Check this - san san replied to Sagar P on 29-Aug-08 02:34 AM
Hi

Take a look at the bellow code...
It will help u out..

Use a Panel and when you click on the button alter the height & width of the panal using threading so that it will slowly take effect in shrinking & enlarging..

// set the color to blue, height & width to 0
            panel1.BackColor = Color.AliceBlue;
            panel1.Height = 0;
            panel1.Width = 0;

// declare some variables
 bool moving = false;
 bool close = false;

public void Button1_Click(object sender, EventArgs e)
{
  panel1.BringToFront();
            if (moving)
            {
                moving = false;
                Thread.Sleep(10);
                close = !close;
            }
            if (close)
            {
                moving  = true;
                while (panel1.Height > panel1.MinimumSize.Height && moving)
                {
                    panel1.Height -= 10;
                    panel1.Width -= 10;
                    Thread.Sleep(10);
                    Application.DoEvents();
                }
                close = false;
                moving  = false;
            }
            else
            {
                moving  = true;
                while (panel1.Height < 200 && moving )
                {
                    panel1.Height += 10;
                    panel1.Width += 10;
                    Thread.Sleep(10);
                    Application.DoEvents();
                }
                close  = true;
                moving  = false;
            }
}


Hope this helps
SAN
Thanks Atul - Sagar P replied to Atul Shinde on 29-Aug-08 02:39 AM

Thanks to All for all your suggestions.

Sujit.

reply to sujit - surbhi_india nn replied to Sagar P on 16-Mar-09 05:02 AM

hi sujit

use notify icon for this, as u'll minimize the window the window's icon will be displayed in the tray (Right hand side of window).. What u have to do is:-

Apply Notify Icon from toolbox

public partial class Login : Form    //Login is the name of form

{

NotifyIcon nicon = new NotifyIcon();     

public Login()

{

InitializeComponent();

this.nicon.Visible = false;

this.Resize += new EventHandler(Login_Resize);   //Login is the name of form

this.nicon.MouseDoubleClick += new MouseEventHandler  (notifyIcon1_MouseDoubleClick);   //as the user will double click on the notify icon the minimized window will appear on the screen

}


private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)

{

this.nicon.Visible = false;

this.Show();

this.WindowState = FormWindowState.Normal;

}

private void Login_Resize(object sender, EventArgs e)

{

if(this.WindowState==FormWindowState.Minimized)

{

this.Hide();

this.nicon.Visible=true;

}

}


Try this and let me know if it helped out or not

regards

surbhi

Swapnil replied to Sagar P on 21-Jan-11 04:11 AM
I want pop up window for my application. I want a popup same like our internet down loader manager(IDM) when any mp3 and pdf file open in my system can u help me

Can you help me.

Thanks in advance.

Swapnil Kumar

Swapnil replied to surbhi_india nn on 21-Jan-11 04:39 AM
I want pop up window for my application. I want a popup same like our internet down loader manager(IDM) when any mp3 and pdf file open in my system can u help me

Can you help me.

Thanks in advance.

Swapnil Kumar

Swapnil replied to Kalit Sikka on 21-Jan-11 04:40 AM
I want pop up window for my application. I want a popup same like our internet down loader manager(IDM) when any mp3 and pdf file open in my system can u help me

Can you help me.

Thanks in advance.

Swapnil Kumar

Swapnil replied to san san on 21-Jan-11 04:40 AM
I want pop up window for my application. I want a popup same like our internet down loader manager(IDM) when any mp3 and pdf file open in my system can u help me

Can you help me.

Thanks in advance.

Swapnil Kumar