Click here to Skip to main content
15,900,108 members
Home / Discussions / C#
   

C#

 
AnswerRe: Regarding Taskbar popup Pin
AB77716-Mar-06 19:42
AB77716-Mar-06 19:42 
GeneralRe: Regarding Taskbar popup Pin
A.Grover6-Mar-06 22:47
A.Grover6-Mar-06 22:47 
GeneralRe: Regarding Taskbar popup Pin
AB77716-Mar-06 23:08
AB77716-Mar-06 23:08 
GeneralRe: Regarding Taskbar popup Pin
A.Grover6-Mar-06 23:49
A.Grover6-Mar-06 23:49 
GeneralRe: Regarding Taskbar popup Pin
AB77717-Mar-06 1:05
AB77717-Mar-06 1:05 
GeneralRe: Regarding Taskbar popup Pin
A.Grover7-Mar-06 18:47
A.Grover7-Mar-06 18:47 
GeneralRe: Regarding Taskbar popup Pin
AB77717-Mar-06 18:53
AB77717-Mar-06 18:53 
GeneralRe: Regarding Taskbar popup Pin
A.Grover7-Mar-06 19:13
A.Grover7-Mar-06 19:13 
my code works like this
in one form i have two button one is hide and another is show . show button popup the form and hide button popup down the form.following is code for form

private void button1_Click(object sender, System.EventArgs e)
{
taskbarNotifier1.nShow();
}
private void button2_Click(object sender, System.EventArgs e)
{
taskbarNotifier1.WHide();
}

// now the taskbarNoitfier code is which has one button on it. which is not showing when the form popup's


<br />
	#region TaskbarNotifier Protected Members<br />
	<br />
		protected Rectangle WorkAreaRectangle;<br />
		protected Timer timer = new Timer();<br />
		protected TaskbarStates taskbarState = TaskbarStates.hidden;<br />
		protected int nShowEvents;<br />
		protected int nHideEvents;<br />
		protected int nVisibleEvents;<br />
		protected int nIncrementShow;<br />
		protected int nIncrementHide;<br />
		protected bool bIsMouseOverPopup = false;<br />
		protected bool bIsMouseOverClose = false;<br />
		protected bool bIsMouseOverContent = false;<br />
		protected bool bIsMouseOverTitle = false;<br />
		protected bool bIsMouseDown = false;<br />
		protected bool bKeepVisibleOnMouseOver = true;			// Added Rev 002<br />
		protected bool bReShowOnMouseOver = false;<br />
		private System.Windows.Forms.Button button1;		// Added Rev 002<br />
<br />
		private int flag=0;<br />
		#endregion<br />
	<br />
		#region TaskbarNotifier Enums<br />
		/// <summary><br />
		/// List of the different popup animation status<br />
		/// </summary><br />
		public enum TaskbarStates<br />
		{<br />
			hidden = 0,<br />
			appearing = 1,<br />
			visible = 2,<br />
			disappearing = 3<br />
		}<br />
		#endregion<br />
<br />
		#region TaskbarNotifier Constructor<br />
		/// <summary><br />
		/// The Constructor for TaskbarNotifier<br />
		/// </summary><br />
		public TaskbarNotifier()<br />
		{<br />
	<br />
			WindowState = FormWindowState.Maximized;<br />
			ShowInTaskbar = false;<br />
		<br />
			timer.Enabled = true;<br />
			timer.Tick += new EventHandler(OnTimer);<br />
		}<br />
		#endregion<br />
<br />
		#region TaskbarNotifier Properties<br />
		/// <summary><br />
		/// Get the current TaskbarState (hidden, showing, visible, hiding)<br />
		/// </summary><br />
		public TaskbarStates TaskbarState<br />
		{<br />
			get<br />
			{<br />
				return taskbarState;<br />
			}<br />
		}<br />
	<br />
		/// <summary><br />
		/// Indicates if the popup should remain visible when the mouse pointer is over it.<br />
		/// Added Rev 002<br />
		/// </summary><br />
		public bool KeepVisibleOnMousOver<br />
		{<br />
			get<br />
			{<br />
				return bKeepVisibleOnMouseOver;<br />
			}<br />
			set<br />
			{<br />
				bKeepVisibleOnMouseOver=value;<br />
			}<br />
		}<br />
<br />
		/// <summary><br />
		/// Indicates if the popup should appear again when mouse moves over it while it's disappearing.<br />
		/// Added Rev 002<br />
		/// </summary><br />
		public bool ReShowOnMouseOver<br />
		{<br />
			get<br />
			{<br />
				return bReShowOnMouseOver;<br />
			}<br />
			set<br />
			{<br />
				bReShowOnMouseOver=value;<br />
			}<br />
		}<br />
<br />
		#endregion<br />
<br />
		#region TaskbarNotifier Public Methods<br />
		[DllImport("user32.dll")]<br />
		private static extern Boolean ShowWindow(IntPtr hWnd,Int32 nCmdShow);<br />
	<br />
		public void nShow()<br />
		{<br />
			flag=0;<br />
			WorkAreaRectangle = Screen.GetWorkingArea(WorkAreaRectangle);<br />
			int nTimeToShow=1300;<br />
			int nTimeToHide=1300;<br />
			nVisibleEvents= 1300;<br />
			// We calculate the pixel increment and the timer value for the showing animation<br />
			int nEvents;<br />
			if (nTimeToShow > 10)<br />
			{<br />
				nEvents = Math.Min((nTimeToShow / 10), 224);<br />
				nShowEvents = nTimeToShow / nEvents;<br />
				nIncrementShow = 224 / nEvents;<br />
			}<br />
			else<br />
			{<br />
				nShowEvents = 10;<br />
				nIncrementShow = 224;<br />
			}<br />
<br />
			//	 We calculate the pixel increment and the timer value for the hiding animation<br />
			if( nTimeToHide > 10)<br />
			{<br />
				nEvents = Math.Min((nTimeToHide / 10), 224);<br />
				nHideEvents = nTimeToHide / nEvents;<br />
				nIncrementHide = 224 / nEvents;<br />
			}<br />
			else<br />
			{<br />
				nHideEvents = 10;<br />
				nIncrementHide = 224;<br />
			}<br />
<br />
			switch (taskbarState)<br />
			{<br />
				case TaskbarStates.hidden:<br />
					taskbarState = TaskbarStates.appearing;<br />
					SetBounds(WorkAreaRectangle.Right-248, WorkAreaRectangle.Bottom-1, 248, 0);<br />
					timer.Interval = nShowEvents;<br />
					timer.Start();<br />
					// We Show the popup without stealing focus<br />
					ShowWindow(this.Handle, 4);<br />
					break;<br />
<br />
				case TaskbarStates.appearing:<br />
					Refresh();<br />
					break;<br />
<br />
				case TaskbarStates.visible:<br />
					timer.Stop();<br />
					timer.Interval = nVisibleEvents;<br />
					timer.Start();<br />
					Refresh();<br />
					break;<br />
					<br />
				case TaskbarStates.disappearing:<br />
					timer.Stop();<br />
					taskbarState = TaskbarStates.visible;<br />
					SetBounds(WorkAreaRectangle.Right-248, WorkAreaRectangle.Bottom-224-1, 248, 224);<br />
					timer.Interval = nVisibleEvents;<br />
					timer.Start();<br />
					Refresh();<br />
					break;<br />
			}<br />
		}<br />
<br />
		public new void Hide()<br />
		{<br />
			if (taskbarState != TaskbarStates.hidden)<br />
			{<br />
				timer.Stop();<br />
				taskbarState = TaskbarStates.hidden;<br />
				base.Hide();<br />
			}<br />
		}<br />
<br />
	<br />
<br />
		public void WHide()<br />
		{<br />
			flag=1;<br />
		}<br />
<br />
		#endregion<br />
<br />
		#region TaskbarNotifier Events Overrides<br />
		protected void OnTimer(Object obj, EventArgs ea)<br />
		{<br />
			switch (taskbarState)<br />
			{<br />
				case TaskbarStates.appearing:<br />
					if (Height < 224)<br />
						SetBounds(Left, Top-nIncrementShow ,Width, Height + nIncrementShow);<br />
					else<br />
					{<br />
						timer.Stop();<br />
						Height = 224;<br />
						timer.Interval = nVisibleEvents;<br />
						taskbarState = TaskbarStates.visible;<br />
						timer.Start();<br />
					}<br />
					break;<br />
<br />
				case TaskbarStates.visible:<br />
					if(flag.Equals(1))<br />
					{<br />
						timer.Stop();<br />
						timer.Interval = nHideEvents;<br />
						taskbarState = TaskbarStates.disappearing;		// Rev 002<br />
						timer.Start();<br />
					}<br />
					break;<br />
				case TaskbarStates.disappearing:<br />
				<br />
					if(flag.Equals(1))<br />
					{<br />
						if (Top < WorkAreaRectangle.Bottom)<br />
							SetBounds(Left, Top + nIncrementHide, Width, Height - nIncrementHide);<br />
						else<br />
								Hide();<br />
					}<br />
				break;<br />
			}<br />
			<br />
		}<br />
<br />
		#endregion<br />
<br />
		private void InitializeComponent()<br />
		{<br />
			this.button1 = new System.Windows.Forms.Button();<br />
			this.SuspendLayout();<br />
			// <br />
			// button1<br />
			// <br />
			this.button1.Location = new System.Drawing.Point(112, 120);<br />
			this.button1.Name = "button1";<br />
			this.button1.TabIndex = 0;<br />
			this.button1.Text = "button1";<br />
			// <br />
			// TaskbarNotifier<br />
			// <br />
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
			this.ClientSize = new System.Drawing.Size(292, 273);<br />
			this.Controls.Add(this.button1);<br />
			this.Name = "TaskbarNotifier";<br />
			this.Load += new System.EventHandler(this.TaskbarNotifier_Load);<br />
			this.ResumeLayout(false);<br />
<br />
		}<br />
<br />
		private void TaskbarNotifier_Load(object sender, System.EventArgs e)<br />
		{<br />
		<br />
		}<br />





Amit Grover
CDAC R&D
GeneralRe: Regarding Taskbar popup Pin
AB77717-Mar-06 23:19
AB77717-Mar-06 23:19 
QuestionHelp Me with "Directory" Pin
hackerhcm6-Mar-06 19:01
hackerhcm6-Mar-06 19:01 
AnswerRe: Help Me with "Directory" Pin
DigitalKing6-Mar-06 19:09
DigitalKing6-Mar-06 19:09 
GeneralRe: Help Me with "Directory" Pin
hackerhcm6-Mar-06 19:47
hackerhcm6-Mar-06 19:47 
AnswerRe: Help Me with "Directory" Pin
Maqsood Ahmed6-Mar-06 19:10
Maqsood Ahmed6-Mar-06 19:10 
Questionmonthcalendar Pin
nassimnastaran6-Mar-06 18:47
nassimnastaran6-Mar-06 18:47 
AnswerRe: monthcalendar Pin
JacquesDP6-Mar-06 18:56
JacquesDP6-Mar-06 18:56 
GeneralRe: monthcalendar Pin
nassimnastaran6-Mar-06 22:29
nassimnastaran6-Mar-06 22:29 
GeneralRe: monthcalendar Pin
Drew McGhie7-Mar-06 9:31
Drew McGhie7-Mar-06 9:31 
QuestionArrayList Problem Pin
AB77716-Mar-06 18:40
AB77716-Mar-06 18:40 
AnswerRe: ArrayList Problem Pin
DigitalKing6-Mar-06 19:03
DigitalKing6-Mar-06 19:03 
GeneralRe: ArrayList Problem Pin
AB77716-Mar-06 19:11
AB77716-Mar-06 19:11 
GeneralRe: ArrayList Problem Pin
DigitalKing6-Mar-06 19:18
DigitalKing6-Mar-06 19:18 
GeneralRe: ArrayList Problem Pin
AB77716-Mar-06 19:28
AB77716-Mar-06 19:28 
QuestionHow to acess a floopy drive in c#? Pin
nitin_ap6-Mar-06 18:38
nitin_ap6-Mar-06 18:38 
AnswerRe: How to acess a floopy drive in c#? Pin
hackerhcm6-Mar-06 18:57
hackerhcm6-Mar-06 18:57 
QuestionRename computer hostname Pin
picasso26-Mar-06 17:28
picasso26-Mar-06 17:28 

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.