LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multicolumn listbox

Solved!
Go to solution

No, this is not correct. You don't need to use an event at all, in order to change the value of a cell in a list box. The double click was just an example.

Altenbach suggested 'value change' of a control. You can write the data to the list box, when the value of the 'data' control changes, or, as shown in the attached example, when a boolean control value changes.

 

When you run your data aquisition code you can also generate a user event (see LabVIEW help) and use it as trigger to write data to the list box.

0 Kudos
Message 11 of 18
(1,376 Views)

Thank you for the very fine example chembo.

You are talking about user events.
Will I be able to create at user event, that triggers, when I enter a cell by using arrow down/up?

The event has to return the row number?

0 Kudos
Message 12 of 18
(1,333 Views)
Solution
Accepted by mkoppelgaard

You don't need user event when you enter a cell using arrow up/down. The value of the list box changes in this case, so you can use the value change event of the listbox.

I am still not sure what you are trying to accomplish. If the sample numbers are imported from Excel and the data is generated via measurement you can just display the results in a table, or even in array of clusters (sample# / data pairs). You could still use user event in order to scroll the table so that the latest measurements become visible.

Anyway, below is a simple example how you could edit the listbox moving up/down with arrow keys.

I attached also one user event example. I am sure that the user event examples in LabVIEW are better, but I cannot access them right now, because my LabVIEW installation here is very basic, so I cannot send you a link.

Download All
0 Kudos
Message 13 of 18
(1,306 Views)

Hallo Clembo Smiley Happy

Thank you very much for your examples and your patience.

Now I understand a whole lot more (not all, but more Smiley Happy).

 

Before I didn’t understand that the value of the listbox changed if you entered a cell in the listbox.

I thought that you had to enter a value in the box in order to change the value of the box.

 

I can use this example I my code. That was what I wanted to accomplish.

 

The user event is a bid difficult for me to understand, but I got an idea. I think, I should read about the background.

I'll properly return soon with now questions. Now I know good explanations can be retrieved

 

0 Kudos
Message 14 of 18
(1,267 Views)

@mkoppelgaard wrote:

Before I didn’t understand that the value of the listbox changed if you entered a cell in the listbox.

I thought that you had to enter a value in the box in order to change the value of the box.


The "value" of a listbox is the highlighted row. It is a simple numeric.

The strings in the cells are just a cosmetic property.

0 Kudos
Message 15 of 18
(1,264 Views)

I just found it confusing that in the "dobbelt click event" the row is called row. 
In value "change event" the row is called newVal...... as I understand it....

0 Kudos
Message 16 of 18
(1,254 Views)

@mkoppelgaard wrote:

I just found it confusing that in the "dobbelt click event" the row is called row. 
In value "change event" the row is called newVal...... as I understand it....


Well they are different contexts so I can see why they would use different names.  The value of a listbox doesn't need to be scalar.  It can be an array, like you selected multiple rows.  In this case the "Value" of the listbox will be a 1D array of numerics, which are the rows that are selected.  Alternatively if you double click a row, even if there are multiple rows selected, you can only double click on one row so the value must be a scalar.

 

So you could have a Row of 5 and a value of [1,2,3,4,5], which is why there aren't always the same thing.

0 Kudos
Message 17 of 18
(1,243 Views)

ah  - okay - I see

0 Kudos
Message 18 of 18
(1,238 Views)