キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Combo Box

How how do I get the text of the item in a Combo Box and the index of the item while scrolling through each item using the arrow up or down key.

I have created a event structure on key press but had know success.

Attached is my example.


Thanks,
Paul
0 件の賞賛
メッセージ1/11
4,549件の閲覧回数
I don't see any way to detect the "selection" as you're scrolling as it hasn't registered as a change or selection until you press enter or click outside the combo box. To get the index of the selection I just output the strings[] and search for the match (see attached)

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 件の賞賛
メッセージ2/11
4,529件の閲覧回数
Please find attached VI for your reference and hope you will find it useful.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
メッセージ3/11
4,517件の閲覧回数
See what happens when you get so wrapped up in the newer "tools"? Remove the "event structure" and Bang! there is the answer. Thanks Ian.


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 件の賞賛
メッセージ4/11
4,504件の閲覧回数
Thank you for all your inputs. The ideas are great unfortunately they will not work in my application because I will have duplicate items. I am filling the combo box with all the available test results of a particular unit from a database and in the event of a retest the serial number that goes in the combo box may repeat. I was hoping the operator could scroll through the serial numbers and in real time I would update the test date, operator and description beside the combo box. In Visual basic this was extremely simple (see below).

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
Label2.Caption = Combo1.ListIndex
End Sub

Private Sub Form_Load()
Combo1.AddItem "one"
Combo1.AddItem "two"
Combo1.AddItem "two"
Combo1.AddItem "four"
End Sub

I have programmed in VB for 10 years and am very use to the event driven language and was hoping labview would have similar functionality without tying up resources.

I appreaciate all the support that I have been given from this form as I make the transition into this LabView graphical programing.

Thanks,
Paul
0 件の賞賛
メッセージ5/11
4,496件の閲覧回数
🙂 Thanks to you too, P.M! Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 件の賞賛
メッセージ6/11
4,482件の閲覧回数
Maybe a Combo box is not what you need! 🙂 (I don't like combo boxes!)

Personally, I'd use a listbox. It's much easier on the operator and works just fine for this purpose. See attached.
メッセージ7/11
4,478件の閲覧回数
Thank you for all the suggestions. I have just finished what I am trying to accomplish using a table and the event structure. It is not as nice as some stuff I have done in VB but it will due.

Thanks again for all the ideas.
Paul
0 件の賞賛
メッセージ8/11
4,468件の閲覧回数
Any changes for us to share your accomplishment? No obligation, however 🙂

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 件の賞賛
メッセージ9/11
4,440件の閲覧回数
I have attached my work around to show the basis of what I am doing. I have saved data in the table since the database is not available.

You will notice as you click on a table item the test identifier is given as well you can scroll through the data with the up/down arrow keys. All actions are event driven therefore not tying up resources.

A neater version of this VI will be called up from the main program and the operator will have the ability to reload data.

Thanks for all the help,
Paul
メッセージ10/11
4,430件の閲覧回数