Windows Develop Bookmark and Share   
 index > Windows Forms General > Mouse Event Handler
 

Mouse Event Handler

Hello ,
I am facing a weird problem. I am using the MouseDown event handler to detect a mouse press on a particular button.
This code works on one PC but does not work on the other.
Both the PCs work on Windows XP OS.
Is there anything I am missing?
Thank you very much in advance
Venksys

The sample code is elow:

private void startButton_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)

{

Cursor.Current = Cursors.WaitCursor;

string Channel_Text_Start;

bool[] dataArray = new bool[1];

dataArray[0]=true;

try

{

reset_Indicator_high = new Task("DO_pin_17_high");

Channel_Text_Start="Dev1/port1/line7";

reset_Indicator_high.DOChannels.CreateChannel(Channel_Text_Start,"Start_Channel_high",ChannelLineGrouping.OneChannelForEachLine);

DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(reset_Indicator_high.Stream);

writer.WriteSingleSampleMultiLine(true, dataArray);

//enable the timer

loopTimer.Enabled = true;

}

catch(DaqException exception)

{

loopTimer.Enabled = false;

MessageBox.Show(exception.Message);

//dispose task

reset_Indicator_high.Dispose();

}

Venksys  Wednesday, October 26, 2005 6:41 PM

Why aren't you handling the button click event? What isn't working on the other PC, do you get some kind of error message?

Daniel Rieck  Wednesday, October 26, 2005 7:14 PM
Thank you Daniel for your response.
I am controlling the digital outputs of a National Instrument's Digital IO PCI card.
This code is basically turning ON a digital output pin to LOGIC HIGH as long as the mouse is kept pressed over the button and goes to LOGIC LOW when the mouse is released. (For this I am using Mouse Up event which is working fine)
The MouseDown Event works fine on one PC while on the other it just turns ON for a few milliseconds and turns LOW even though the mouse is kept pressed!!!

Venksys  Thursday, October 27, 2005 1:32 AM

You can use google to search for other answers

Custom Search

More Threads

• Reports
• Problem with Open/execute file.
• Collapsible Panel and Custom Control
• How to Implement Custom ComboBox?
• How to get a control's position to the whole screen?
• Line & Character Spacing
• vs2005 c# -- How to create a Modal Dialog Box?
• Prequisite in Deployment
• WinForm Class Library and AppUpdater component
• How to load more than 1 million items in ListView without killing the memory?