04-24-2011 02:40 AM
04-24-2011 09:30 AM
04-24-2011 12:03 PM
Are these 'objects' in a picture control? If so, look at the examples - i.e. Pen Attributes And Image subsetting.vi.
04-24-2011 10:53 PM
I may want to select some buttons. To select picture control I may also need to select outside these controls, not inside them.
Is the second post blank? Thanks.
04-24-2011 11:24 PM
Please give some more information here on what you are trying to do.
Is this something you are trying to do in a VI while you are editing? Or something while a VI is running? And why? Post a VI so we can see what you are trying to work with.
04-25-2011 04:39 AM
As the attached vi, when in runtime, the selected 4 object need to change color. Or the click one need to change color. Thanks.
04-25-2011 08:58 AM
You are going to need to use an event structure with the mouse down and mouse up events on the pane. You are going to need to use the mouse coordinates at the down and up events to determine the rectangle you have dragged, then figure out which buttons are within that rectangle. Doable, but not necessarily easy. One thing I don't have an answer for is how to draw the box around them while dragging.
For doing one button at a time, then you can use the mouse down, mouse up, or value change event for the button.
04-25-2011 10:29 AM
To draw a rectangle like that you'd need to draw right on the window's pane using operating system calls (not trivial), or you'd need to manipulate some LabVIEW object, like a decoration to resize as you move the mouse. The latter is doable, but I'm not sure it would be worth the effort. I would suggest an alternative approach, such as allowing the user to use the Control and/or Shift key as click modifiers to select/deselect objects. You can easily check if these keys were held down at the time of a MouseDown event with the event structure.