|
-
Jun 6th, 2010, 12:09 AM
#1
Thread Starter
Lively Member
ComboBox SelectedItem to Text...
Here's what I'm looking for but I haven't come up with an idea on how to approach the issue...
Basically the application I'm creating has a login screen with two textboxes and one ComboBox... Once the user enters their first and last time for the first time it'll be stored in the combobox's index..
Now my issue is this... Originally before I implemented the combobox the related user file name would be:
"C:\FicheStats\John Smith\January\" + Textbox1.text + Textbox2.text + ".txt"
So basically the user filename would be JohnSmith.text
But now I want the user to directly select from the combobox and that the file name remains the same without space.... but in the combobox the name appears as John Smith...
Now what I want to do is tell the program that the name in the combobox is the filename but without a space... so i'd need to find way for the program to read John Smith as JohnSmith or tell the program that when there is a space to bind both text parts >_>
-
Jun 6th, 2010, 06:11 AM
#2
Re: ComboBox SelectedItem to Text...
Well if it is always going to be the same format, where you just want to remove any spaces, then you could just use String.Replace to replace the space with nothing, e.g something like:
vb Code:
Dim FileName As String
FileName = ComboBox1.SelectedItem.ToString.Replace(" ", String.Empty)
-
Jun 6th, 2010, 10:27 AM
#3
Thread Starter
Lively Member
Re: ComboBox SelectedItem to Text...
thanks I'll try it soon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|