﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » How do I retrieve the value from a combo box?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 15 Sep 2026 11:44:35 GMT</lastBuildDate><ttl>20</ttl><item><title>How do I retrieve the value from a combo box?</title><link>http://forum.strataframe.net/FindPost9738.aspx</link><description>Hi all. I am a little confused regarding lists and combo box's I guess.  I looked at the tutorial and but I don't see how you "get" the values from the selected record from the list or combo box.  I have a combo box set up on my custom password form with two columns, FullName and ID: {0},{1} respectivly. Now, the value I need to retrieve is the ID value. I tried placing some code in the events SelectedIndexChanged with no joy. I'm not sure of the arguments to use to get my value. Can someone please help me.  ID is an Integer.  &lt;br&gt;
&lt;br&gt;
The second part: What I'm trying to do is, after getting the ID number is send that number to my function and have the funtion run a select to get the employee record and return to me the password. I will then assign it to my var EmpPW as seen below.  cboFullName is the name of the Combobox and I'm guessing at .ValueMember&lt;br&gt;
&lt;br&gt;
Am I wrong or right?  If incorrect then how do I do this?&lt;br&gt;
&lt;br&gt;
My code to send to my Function is: EmpPW = Me.EmployeeBO1.GetEmpoyeeByID(txtFullName.ValueMember.&lt;br&gt;
&lt;br&gt;
Thanks in advance&lt;br&gt;
&lt;br&gt;
Robert&lt;br&gt;
(New to .Net)</description><pubDate>Fri, 22 Jun 2007 13:09:21 GMT</pubDate><dc:creator>Robert Carl Johnson</dc:creator></item><item><title>RE: How do I retrieve the value from a combo box?</title><link>http://forum.strataframe.net/FindPost9751.aspx</link><description>[quote]&lt;SPAN id=ctl02_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl09_lblFullMessage&gt;Boy do I feel dumb. I didn't think to check normal behavior.&lt;/SPAN&gt;[/quote]&lt;/P&gt;&lt;P&gt;Don't feel this way at all!!!&amp;nbsp; I am glad that you asked as at least you now know how it works.&amp;nbsp; If you don't ask you don't learn :)&amp;nbsp; Please don't let this deter you from posting questions in the future!!! :)</description><pubDate>Fri, 22 Jun 2007 13:09:21 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I retrieve the value from a combo box?</title><link>http://forum.strataframe.net/FindPost9748.aspx</link><description>Don't feel bad.  I remember a bit O'head banging over this myself (among other simple things)  :D</description><pubDate>Fri, 22 Jun 2007 12:47:40 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How do I retrieve the value from a combo box?</title><link>http://forum.strataframe.net/FindPost9746.aspx</link><description>Boy do I feel dumb. I didn't think to check normal behavior...  I just figured it would be a SF property... lol. Well that teaches me a lesson.&lt;br&gt;
&lt;br&gt;
Thanks for the reply Trent,&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
&lt;br&gt;
Robert</description><pubDate>Fri, 22 Jun 2007 12:26:33 GMT</pubDate><dc:creator>Robert Carl Johnson</dc:creator></item><item><title>RE: How do I retrieve the value from a combo box?</title><link>http://forum.strataframe.net/FindPost9740.aspx</link><description>If you are using the population data source settings on the control, then you specify the value member.&amp;nbsp; It might help if you just look into how a combo box natively works when using a DataSource as this is really all that we do behind the scenes.&amp;nbsp; We populate based on your PopulationDataSourceSettings property or Enumeration then create an ADO.NET data table that has two fields...Description and Value.&amp;nbsp; The description is what you see that is defined in the Display Member Format String field and the Value is set to the Value Member.&lt;/P&gt;&lt;P&gt;All Lists and Combos have a property called SelectedValue which gives you the "selected' value of the control.&amp;nbsp; Likewise if you want to get the display value you can just reference the Text property.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/89e5c9aa-aa2f-407c-a19a-c5ca.png"&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;[codesnippet]Dim lnValue As Integer = CType(MyCombo.SelectedValue, Integer)[/codesnippet]&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;[codesnippet]Dim lcDisplayText As String = MyCombo.Text[/codesnippet]</description><pubDate>Fri, 22 Jun 2007 10:31:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>