Skip to main content
guest
Join
|
Help
|
Sign In
RockyVB
Home
guest
|
Join
|
Help
|
Sign In
Wiki Home
Recent Changes
Pages and Files
Members
Home
Handy Hint Example
Handy Hints
Great Code
Good VB Resources
Instructor Resources
How to use Wikispaces
2011 S2 Joel Boorman HH and Presentation
Edit
0
7
…
1
Tags
handy hints
Notify
RSS
Backlinks
Source
Print
Export (PDF)
Presentation
Artificial Intelligence.pptx
Details
Download
4 MB
Seminar Report
Handy Hint 1: Saving the Contents of a Combo Box
Dim filename, box as String
filename = "output.txt"
box = " "
SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Ok Then
SaveFileDialog1.InitialDirectory = CurDir()
SaveFileDialog1.Filter = "Text Files(*.txt) | *.txt | All files (*.*) | *.*"
SaveFileDialog1.FilterIndex = 1
SaveFileDialog.Filename = filename
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Ok then
FileOpen(1, filename, OpenMode.Output)
While Not EOF(1)
Input(1, box)
cboBox.Items.Add(box)
End While
FileClose(1)
Else
Messagebox.show("No File was Found! Try again!", "No File!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
Handy Hint 2: Select Last Index in a Combo Box
cboTest.SelectedIndex = cboTest.Items.Count - 1
*Note that this will only work if there is data in the combo box*
' Note: This is also a comment Lewis '
Javascript Required
You need to enable Javascript in your browser to edit pages.
help on how to format text
Turn off "Getting Started"
Home
...
Loading...
Seminar Report
Handy Hint 1: Saving the Contents of a Combo Box
Dim filename, box as String
filename = "output.txt"
box = " "
SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Ok Then
SaveFileDialog1.InitialDirectory = CurDir()
SaveFileDialog1.Filter = "Text Files(*.txt) | *.txt | All files (*.*) | *.*"
SaveFileDialog1.FilterIndex = 1
SaveFileDialog.Filename = filename
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.Ok then
FileOpen(1, filename, OpenMode.Output)
While Not EOF(1)
Input(1, box)
cboBox.Items.Add(box)
End While
FileClose(1)
Else
Messagebox.show("No File was Found! Try again!", "No File!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
Handy Hint 2: Select Last Index in a Combo Box
cboTest.SelectedIndex = cboTest.Items.Count - 1
*Note that this will only work if there is data in the combo box*
' Note: This is also a comment Lewis '