January 12th, 2010, 05:24 AM
Join Date: Jan 2010
Time spent in forums: 1 h 5 m 47 sec
Reputation Power: 0
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
'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..