: here is my solution to my problem.
: //set location of chocolate, transform this.Location into screen point
: //and set screen point of chocolate to that
: Point ChocPos = this.Location;
: ChocPos.X = this.Size.Width;
: ChocPos.Y = this.Size.Height - this.Size.Height; //strange but works
:
: ChocPos = this.PointToScreen(ChocPos);
: mChocolateForm.Location = ChocPos;
: mChocolateForm.BringToFront();
:
: Timer anotherT = (Timer)obj;
: anotherT.Stop();
: anotherT.Tick -= new EventHandler(myTimerTicks);
:
: mChocolateForm.ShowInTaskbar = true; //set on false when finished with button
: mChocolateForm.Show();
: }
: }
: what do you say
:
I bet your solution works, here is my way, see if you find it more attractive
private void onMyMouseHover(object sender, EventArgs ea)
{ // begin handler
// i luve threads ;p
Thread chocFormCreating = new Thread(new ThreadStart(this.ChocolateFormCreator));
chocFormCreating.Start();
} // end handler
private void CholocateFormCreator()
{ // begin Creator
// wait 1 second and then create the chocolf
Thread.Sleep(1000);
mChocolateForm = new ChocolateForm( ImageList, mColuns, this );
mChocolateForm.Closing += new System.ComponentModel.CancelEventHandler(this.chocoClosing);
if ( mChocolateForm == null )
{ // begin if statement
mChocolateForm = new ChocolateForm( ImageList, mColuns, this );
mChocolateForm.Closing += new System.ComponentModel.CancelEventHandler(this.chocoClosing);
//set location of chocolate, transform this.Location into screen point
//and set screen point of chocolate to that
Point ChocPos = this.Location;
ChocPos.X = this.Size.Width;
ChocPos.Y = this.Size.Height - this.Size.Height; //strange but works
ChocPos = this.PointToScreen(ChocPos);
mChocolateForm.Location = ChocPos;
mChocolateForm.BringToFront();
mChocolateForm.ShowInTaskbar = true; //set on false when finished with button
mChocolateForm.Show();
}// end if
}// end creator
Greetings from Bulgaria