Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
QuestionTrouble calling cpp dll function whose input is char** [modified] Pin
platso_5888-Oct-09 2:22
platso_5888-Oct-09 2:22 
AnswerRe: Trouble calling cpp dll function whose input is char** Pin
Luc Pattyn8-Oct-09 2:52
sitebuilderLuc Pattyn8-Oct-09 2:52 
Questionchange picture of image controll in gridvie in windows application???? [not solved yet...] Pin
mr.mohsen8-Oct-09 1:16
mr.mohsen8-Oct-09 1:16 
AnswerRe: change picture of image controll in gridvie???? Pin
Atif Ali Bhatti8-Oct-09 1:40
Atif Ali Bhatti8-Oct-09 1:40 
GeneralRe: change picture of image controll in gridvie???? Pin
mr.mohsen8-Oct-09 2:34
mr.mohsen8-Oct-09 2:34 
AnswerRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 4:18
Henry Minute8-Oct-09 4:18 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 7:30
mr.mohsen8-Oct-09 7:30 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 8:41
Henry Minute8-Oct-09 8:41 
Then handle the CellClick event of the DataGridView:
private Bitmap start = new Bitmap("LocationForImage");
private Bitmap stop = new Bitmap("LocationForImage");
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
    // Try to load it as a DataGridViewImageCell
    DataGridViewImageCell img = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewImageCell
    // If that works, we have the right cell
    if (img != null)
    {
        if ((bool)img.Tag)
        {
            // if it is true then we are started, so stop
            img.Value = stop;
            img.Tag = false;
            // HERE DO ANYTHING ELSE REQUIRED FOR STOPPING e.g. this.timer1.Stop;
        }
        else
        {
            // if it is false then we are stopped, so start
            img.Value = start;
            img.Tag = true;
            // HERE DO ANYTHING ELSE REQUIRED FOR STARTING e.g. this.timer1.Start;
        }
    }
}


This assumes that there is only one Image column.
As you initially load the data into the image cells, you must set the Tag property to either true (start image used) or false (stop image used)

I hope that this helps. Smile | :)

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 picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 9:05
mr.mohsen8-Oct-09 9:05 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
Henry Minute8-Oct-09 9:44
Henry Minute8-Oct-09 9:44 
GeneralRe: change picture of image controll in gridvie in windows application???? Pin
mr.mohsen8-Oct-09 12:24
mr.mohsen8-Oct-09 12:24 
QuestionCreating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 0:30
RobertFall8-Oct-09 0:30 
AnswerRe: Creating a Designer Add-In for Visual Studio Pin
Richard MacCutchan8-Oct-09 0:44
mveRichard MacCutchan8-Oct-09 0:44 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 0:48
RobertFall8-Oct-09 0:48 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
Richard MacCutchan8-Oct-09 1:08
mveRichard MacCutchan8-Oct-09 1:08 
GeneralRe: Creating a Designer Add-In for Visual Studio Pin
RobertFall8-Oct-09 1:43
RobertFall8-Oct-09 1:43 
QuestionComparing for Columns Pin
Yonathan11117-Oct-09 23:25
professionalYonathan11117-Oct-09 23:25 
AnswerRe: Comparing for Columns Pin
Pete O'Hanlon8-Oct-09 0:02
mvePete O'Hanlon8-Oct-09 0:02 
AnswerRe: Comparing for Columns Pin
dan!sh 8-Oct-09 0:41
professional dan!sh 8-Oct-09 0:41 
Questionforms loading events!!! Pin
faheemnadeem7-Oct-09 23:14
faheemnadeem7-Oct-09 23:14 
AnswerRe: forms loading events!!! Pin
Christian Graus7-Oct-09 23:18
protectorChristian Graus7-Oct-09 23:18 
GeneralRe: forms loading events!!! Pin
faheemnadeem7-Oct-09 23:27
faheemnadeem7-Oct-09 23:27 
AnswerRe: forms loading events!!! Pin
Alan N8-Oct-09 0:11
Alan N8-Oct-09 0:11 
GeneralRe: forms loading events!!! Pin
Mycroft Holmes8-Oct-09 1:10
professionalMycroft Holmes8-Oct-09 1:10 
GeneralRe: forms loading events!!! Pin
Alan N8-Oct-09 2:00
Alan N8-Oct-09 2:00 

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.