Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old February 13th, 2008, 07:21 PM
Registered User
Join Date: Feb 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Finally found this forum. I took your advice from 2004 and the above conversation. I created an object with "Description" and "Value" properties. Then I loaded these objects from an ENUM which contains text like ICE_Ice_And_Rain and populated the ComboBox with these. Still couldn't get the ComboBox to display "Value" after "Description" was selected so I CHEATED. I covered the ComboBox edit area with a TextBox which behaved as desired (I'm a student programer, and was totally frustrated after three days on this problem).

Here's code from LOAD.
Names = [Enum].GetNames(GetType(SystemNames.Systems))
For i = 0 To Names.Length - 1
     BrokenUp = Names(i).Split("_")
     For j = 1 To BrokenUp.Length - 1
         Description = Description & BrokenUp(j) & " "
     Next j
     Value = BrokenUp(0)
     cboSystems.Items.Add(New SystemNames(Description, Value))
     cboSystems.DisplayMember = "Description"
     Description = ""
Next i

Then the DropDownClosed code.
If cboSystems.SelectedIndex = -1 Then Exit Sub
     txtSystems.Visible = True
     txtSystems.Text = CType(sender.selecteditem, SystemNames).Value

Finally the TextBox GotFocus() code.
txtSystems.Visible = False
cboSystems.Text = " " & txtSystems.Text

Thanks again,
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox Populating Delay aw23 Access VBA 24 June 8th, 2005 03:39 AM
populate data in a windows form combobox from a da anibiswas General .NET 0 March 4th, 2005 03:57 PM
Populating report or form textboxes Bosstone100 Access VBA 3 November 15th, 2004 03:53 PM
Populating a form maneor Access 1 September 30th, 2004 03:41 PM
Populating Combobox by Code Syed Afzal Ahmed ADO.NET 1 July 12th, 2003 03:34 AM

All times are GMT -4. The time now is 06:00 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.