Visual Basic

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDesktop ProgrammingVisual Basic

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old January 12th, 2010, 05:24 AM
Archit Archit is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2010
Posts: 2 Archit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 47 sec
Reputation Power: 0
Question Need Combobox help...

hi to all,
ok here is the problem.
i wanna create an app which can take information and make notepad file of that data. Users can make any number of notepad files they want.

The prbolem: i want to show all the users files in combo box whic i did it.

but i don't know how to make that file show when user clicks on that name .

here is the code of mine.

''form load code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cur As String
cur = System.Environment.CurrentDirectory.ToString ' gets current dir
Dim str As String
Dim files As String() = Directory.GetFiles(cur, "*.txt")

For Each str In files
CB1.Items.Add(Path.GetFileNameWithoutExtension(str ))
Next

End Sub

'The above code adds names of all the files who have .txt extension in combobox (CB1)

what i want to do is i wanna open the file when user clicks on the particular name in combobox (CB1)

for example : file is test.txt
combobox shows "test.txt"
and when user or i clicks on "test" ,
the test file will get open in notepad.

i know how to open file i.e using process.start.
but dont know how to make that file open..

Reply With Quote
  #2  
Old June 25th, 2010, 05:13 PM
Ash.Burlaczenko Ash.Burlaczenko is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Posts: 3 Ash.Burlaczenko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 36 sec
Reputation Power: 0
Hi Archit

I think I know what your asking for. Here's my solution -

You code goes on the SelectedIndexChanged function of your combobox which is written for you if you double click on the combobox.

Then when the combobox is changed use the follow to get the text.

Dim filename as String = CB1.SelectedItem.ToString()

Hope this helps.

Reply With Quote
  #3  
Old January 15th, 2014, 10:14 PM
xiaoyuandlg xiaoyuandlg is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2013
Posts: 5 xiaoyuandlg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 58 sec
Reputation Power: 0
Quote:
Originally Posted by Ash.Burlaczenko
Hi Archit

I think I know what your asking for. Here's my solution -

You code goes on the SelectedIndexChanged function of your combobox which is written for you if you double click on the combobox control.

Then when the combobox is changed use the follow to get the text.

Dim filename as String = CB1.SelectedItem.ToString()

Hope this helps.


I conceive that I can't agree more with you!

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingVisual Basic > Need Combobox help...


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap