Click here to Skip to main content
15,913,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: Removing last line in a file Pin
Le centriste24-Jan-06 9:53
Le centriste24-Jan-06 9:53 
Questionsmtp Pin
fmardani24-Jan-06 0:46
fmardani24-Jan-06 0:46 
Question1.1 to 2.0 Pin
fmardani23-Jan-06 23:47
fmardani23-Jan-06 23:47 
AnswerRe: 1.1 to 2.0 Pin
Mike Dimmick24-Jan-06 0:26
Mike Dimmick24-Jan-06 0:26 
GeneralRe: 1.1 to 2.0 Pin
fmardani24-Jan-06 0:29
fmardani24-Jan-06 0:29 
GeneralRe: 1.1 to 2.0 Pin
Mike Dimmick24-Jan-06 8:13
Mike Dimmick24-Jan-06 8:13 
QuestionHow to make messenger like popup messages Pin
User 231751423-Jan-06 23:43
User 231751423-Jan-06 23:43 
AnswerRe: How to make messenger like popup messages Pin
AB777124-Jan-06 0:22
AB777124-Jan-06 0:22 
i had created a taskbar pop up

u can use the following code
u need to add this form in ur project and call it when
u want to display the pop up message

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Reflection;

namespace TaskBarPopUp
{
///
/// Summary description for Form1.
///

public class Form1 : System.Windows.Forms.Form
{
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

private string contenttext;
Timer timer;
bool Displayed = false;
private System.Windows.Forms.Label lblContent;
Point po;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.BackColor = Color.CornflowerBlue;
lblContent.BackColor = Color.CornflowerBlue;
this.Opacity = 0;
timer = new Timer();
timer.Interval = 100;
timer.Tick += new EventHandler(timer_Tick);
po = new Point(MousePosition.X,MousePosition.Y);
//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.lblContent = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lblContent
//
this.lblContent.Font = new System.Drawing.Font("Bookman Old Style", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.lblContent.Location = new System.Drawing.Point(0, 0);
this.lblContent.Name = "lblContent";
this.lblContent.Size = new System.Drawing.Size(368, 96);
this.lblContent.TabIndex = 0;
this.lblContent.Text = "This is a Pop Up";
this.lblContent.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblContent.MouseEnter += new System.EventHandler(this.lblContent_MouseEnter);
this.lblContent.MouseLeave += new System.EventHandler(this.lblContent_MouseLeave);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.SystemColors.ActiveBorder;
this.ClientSize = new System.Drawing.Size(368, 93);
this.ControlBox = false;
this.Controls.Add(this.lblContent);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "Form1";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.TopMost = true;
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());

}

public string Content
{
get{return contenttext;}
set{contenttext = value;}
}

public void SetContent(string str)
{
lblContent.Text = "You Have Received A Message From \n"+ str;
contenttext = str;
}

public void Show(int TimeToShow, int TimeToStay, int TimeToHide)
{

}

private void lblContent_Click(object sender, System.EventArgs e)
{

}

private void Form1_Load(object sender, System.EventArgs e)
{
Rectangle workArea = Screen.GetWorkingArea(this);
SetBounds(workArea.Width - this.Width-5,workArea.Height - this.Height, this.Width , this.Height);
timer.Start();

}

private void timer_Tick(object sender, EventArgs e)
{

if(Displayed == false)
{
this.Opacity += 0.1;
if(this.Opacity == 1)
{
Displayed = true;
}
}
else
{timer.Interval = 1;

if(po.X >= this.Location.X && po.Y >= this.Location.Y)
{

timer.Stop();
}
if(this.Opacity >=0.1)
this.Opacity -= 0.01;
if(this.Opacity >= 0 && this.Opacity <= 0.1)
{
timer.Stop();
Application.Exit();

}



}

}



private void lblContent_MouseLeave(object sender, System.EventArgs e)
{
lblContent.ForeColor = Color.Black;
Displayed = true;
this.Opacity = 1;
timer.Start();
}

private void lblContent_MouseEnter(object sender, System.EventArgs e)
{
string txt = lblContent.Text;

lblContent.ForeColor = Color.White;
timer.Stop();
Displayed = false;
this.Opacity = 1;

}

}
}
GeneralRe: How to make messenger like popup messages Pin
User 231751424-Jan-06 1:15
User 231751424-Jan-06 1:15 
QuestionAbout design time support in inherited TextBox control Pin
Kamrul Hasan23-Jan-06 23:20
Kamrul Hasan23-Jan-06 23:20 
AnswerRe: About design time support in inherited TextBox control Pin
AB777124-Jan-06 2:06
AB777124-Jan-06 2:06 
QuestionPopUp form Pin
PHDENG8123-Jan-06 23:01
PHDENG8123-Jan-06 23:01 
AnswerRe: PopUp form Pin
AB777124-Jan-06 0:26
AB777124-Jan-06 0:26 
GeneralRe: PopUp form Pin
PHDENG8124-Jan-06 0:28
PHDENG8124-Jan-06 0:28 
QuestionForm Background image problems Pin
NewbieDude23-Jan-06 22:00
NewbieDude23-Jan-06 22:00 
QuestionShowDialog Pin
microsoc23-Jan-06 21:28
microsoc23-Jan-06 21:28 
AnswerRe: ShowDialog Pin
AB777124-Jan-06 0:30
AB777124-Jan-06 0:30 
GeneralRe: ShowDialog Pin
microsoc24-Jan-06 15:06
microsoc24-Jan-06 15:06 
GeneralRe: ShowDialog Pin
AB777124-Jan-06 16:41
AB777124-Jan-06 16:41 
QuestionRe: ShowDialog Pin
microsoc24-Jan-06 20:47
microsoc24-Jan-06 20:47 
AnswerRe: ShowDialog Pin
AB777124-Jan-06 21:06
AB777124-Jan-06 21:06 
AnswerRe: ShowDialog Pin
AB777124-Jan-06 21:23
AB777124-Jan-06 21:23 
GeneralRe: ShowDialog Pin
microsoc24-Jan-06 23:48
microsoc24-Jan-06 23:48 
Questionxls File Parser Pin
xoxoxoxoxoxox23-Jan-06 21:15
xoxoxoxoxoxox23-Jan-06 21:15 
AnswerRe: xls File Parser Pin
albCode24-Jan-06 2:11
albCode24-Jan-06 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.