-
September 20th, 2012, 03:20 PM
#16
Re: Button images
Hi Arjay,
Thanks for the Zipper, It took me a while to get thinks going.... even whith your program.
Will keep you guys updated,
regards,
ger
-
October 23rd, 2012, 01:10 PM
#17
Re: Button images
Hi all,
So far everything is working.
Still one minor detail.
the Pictures I use have round edges, and they do not cover the whole button.
So when the mouse pointer enters the button area the picture changes.
But the backcolor changes also, giving very annoying results.
So my quest, How do I turn of the backcolor change on mouse enter and mouse click.
Transparent does not do the trick.
Regards,
gerwin
-
October 23rd, 2012, 09:48 PM
#18
Re: Button images
Originally Posted by TBBW
So my quest, How do I turn of the backcolor change on mouse enter and mouse click.
Transparent does not do the trick.
Do the button images have transparent corners?
-
October 24th, 2012, 03:11 AM
#19
Re: Button images
Yep, the corners are transparent and I use Zoom to place the image on the button.
regards.
-
October 26th, 2012, 04:27 AM
#20
Re: Button images
Hi all,
To make life easier I changed the button control to a picturebox.
Does the same for me as I use three pictures for all the events.
To give you an idea, a dark picture when the 'button' is idle.
a light picture when the mouse is over the 'button'
and the flash picture when the button is clicked.
I'm using the code which was posted in the beginning of this thread.
But now I encounter the following situation;
Code:
private void pictureBox1_Click(object sender, EventArgs e)
{
FlashPicture = (PictureBox)sender;
Thread FlashThePictureThread = new Thread(FlashThePicture);
FlashThePictureThread.Start();
}
void FlashThePicture()
{
BeginInvoke(new MethodInvoker(Performflash));
Thread.Sleep(250);
BeginInvoke(new MethodInvoker(Performflash));
Thread.Sleep(250);
}
void Performflash()
{
if ((FlashPicture.BackgroundImage == ImageB1) || (FlashPicture.BackgroundImage == ImageC1))
FlashPicture.BackgroundImage = ImageA1;
else
FlashPicture.BackgroundImage = ImageB1;
}
This gives the flash only, for the rest it does not do anything.
What I like is the following:
Code:
private void pictureBox1_Click(object sender, EventArgs e)
{
FlashPicture = (PictureBox)sender;
Thread FlashThePictureThread = new Thread(FlashThePicture);
FlashThePictureThread.Start();
this.Hide();
COD1 cod1 = new COD1();
cod1.ShowDialog();
this.Show();
}
but this does not work.
(The next Dialog is called, the previous one is hidden, but there is no flash of the 'button')
Where do I go wrong.
regards,
Gerwin
By the way I downloaded "threading in C# from Joseph Albahari"
Last edited by TBBW; October 26th, 2012 at 04:35 AM.
Reason: editorial
-
November 1st, 2012, 08:08 AM
#21
Re: Button images
Hi all,
Solved all the 'problems' on the button change picture issues!!! (YES YES YES)
Will post the complete solution in the next couple of days, will be helpfull for a lot of us.
regards,
Gerwin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|