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

C#

 
AnswerRe: globalizatin Pin
Rajesh R Subramanian27-Aug-09 4:44
professionalRajesh R Subramanian27-Aug-09 4:44 
AnswerRe: globalizatin Pin
Luc Pattyn27-Aug-09 7:42
sitebuilderLuc Pattyn27-Aug-09 7:42 
QuestionChange color of ten or more PictureBoxes Pin
Lyon Sun27-Aug-09 0:48
Lyon Sun27-Aug-09 0:48 
AnswerRe: Change color of ten or more PictureBoxes Pin
Henry Minute27-Aug-09 1:05
Henry Minute27-Aug-09 1:05 
AnswerRe: Change color of ten or more PictureBoxes Pin
Lyon Sun27-Aug-09 1:50
Lyon Sun27-Aug-09 1:50 
GeneralRe: Change color of ten or more PictureBoxes Pin
Henry Minute27-Aug-09 2:14
Henry Minute27-Aug-09 2:14 
GeneralRe: Change color of ten or more PictureBoxes Pin
Lyon Sun27-Aug-09 2:38
Lyon Sun27-Aug-09 2:38 
GeneralRe: Change color of ten or more PictureBoxes Pin
Henry Minute27-Aug-09 3:00
Henry Minute27-Aug-09 3:00 
Option 1 (probably the easiest)

Declare two class level PictureBox variables, one for the first (mousedown) and one for the second (mouseup).
In the MouseDown and MouseUp event handlers, identify the PictureBox where the event occurred and assign it to the correct variable.
Add a call to ColorChanged() at the end of the MouseUp handler

I'll do the MouseDown, from that you can work out how to do MouseUp
private PictureBox firstBox = null;
private PictureBox secondBox = null;
private void OnMouseDown(object sender, MouseEventArgs e)
{
    PictureBox pb = sender as PictureBox;
    if (pb != null)
    {
        firstBox = pb;
    }
    else
    {
        firstBox = null;
    }
    StartTime = getTimeAt(e.X, e.Y);
    Updating();
}


after making the changes to MouseUp your ColorChanged() should firstly check if firstBox or secondBox is null, and if so return (nothing to do if you don't have two PictureBoxes). then it is simply a matter of firstBox.BackColor = Color.Blue; (same for secondBox), or however you want to set the color.

I won't give you the second idea unless you don't think this will work as it is far more complicated.

Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Change color of ten or more PictureBoxes Pin
Lyon Sun27-Aug-09 3:53
Lyon Sun27-Aug-09 3:53 
QuestionRe: Change color of ten or more PictureBoxes Pin
Lyon Sun27-Aug-09 20:34
Lyon Sun27-Aug-09 20:34 
AnswerRe: Change color of ten or more PictureBoxes Pin
Henry Minute28-Aug-09 2:45
Henry Minute28-Aug-09 2:45 
AnswerRe: Change color of ten or more PictureBoxes Pin
Lyon Sun28-Aug-09 9:27
Lyon Sun28-Aug-09 9:27 
Questiongrid view Pin
ankitjain111026-Aug-09 23:47
ankitjain111026-Aug-09 23:47 
AnswerRe: grid view Pin
Vimalsoft(Pty) Ltd26-Aug-09 23:57
professionalVimalsoft(Pty) Ltd26-Aug-09 23:57 
GeneralRe: grid view Pin
ankitjain111027-Aug-09 0:10
ankitjain111027-Aug-09 0:10 
GeneralRe: grid view Pin
Vimalsoft(Pty) Ltd27-Aug-09 0:13
professionalVimalsoft(Pty) Ltd27-Aug-09 0:13 
QuestionAdding values to datatable Pin
myinstincts26-Aug-09 23:14
myinstincts26-Aug-09 23:14 
AnswerRe: Adding values to datatable Pin
Vimalsoft(Pty) Ltd26-Aug-09 23:25
professionalVimalsoft(Pty) Ltd26-Aug-09 23:25 
AnswerRe: Adding values to datatable Pin
kKamel26-Aug-09 23:26
kKamel26-Aug-09 23:26 
GeneralRe: Adding values to datatable [modified] Pin
myinstincts26-Aug-09 23:39
myinstincts26-Aug-09 23:39 
GeneralRe: Adding values to datatable Pin
kKamel27-Aug-09 0:40
kKamel27-Aug-09 0:40 
QuestionHardware Acceleration on a PictureBox / Non-Apparent Image in Screenshot Pin
Trapper-Hell26-Aug-09 23:09
Trapper-Hell26-Aug-09 23:09 
AnswerRe: Hardware Acceleration on a PictureBox / Non-Apparent Image in Screenshot Pin
stancrm26-Aug-09 23:57
stancrm26-Aug-09 23:57 
GeneralRe: Hardware Acceleration on a PictureBox / Non-Apparent Image in Screenshot Pin
Trapper-Hell27-Aug-09 1:08
Trapper-Hell27-Aug-09 1:08 
Questionmake available C# namespace in ATL projects. Pin
SRKSHOME26-Aug-09 22:54
SRKSHOME26-Aug-09 22:54 

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.