J
jcoon
All,
I'm new to VB, I'm trying to load data into two colunms of a list box
or datagrid. I'm not sure how to get my data into the second colunms of the
list box and If I can post this type of data into a data grid view. any
suggestions are welome. also, can headers be added to a list box?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim elevDsection As Double
elevDsection = 150
Dim strFormat As String
strFormat = "#0.00"
Dim slope As Double
Dim samplestartdist As Double
Dim sampledist As Double
Dim rwoffset As Double
Dim offsetelevdist As Double
Dim offsetelev As Double
slope = 1 / 34
offsetelevdist = 100
offsetelev = (slope * offsetelevdist) + elevDsection
samplestartdist = 0
sampledist = 500 + offsetelevdist
rwoffset = 0
rwoffset = rwoffset
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.HorizontalScrollbar = False
Do While sampledist > 0
ListBox1.Items.Add(rwoffset)
rwoffset = rwoffset + offsetelevdist
sampledist = sampledist - offsetelevdist
offsetelev = (slope * rwoffset) + elevDsection
Loop
end sub
I'm new to VB, I'm trying to load data into two colunms of a list box
or datagrid. I'm not sure how to get my data into the second colunms of the
list box and If I can post this type of data into a data grid view. any
suggestions are welome. also, can headers be added to a list box?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim elevDsection As Double
elevDsection = 150
Dim strFormat As String
strFormat = "#0.00"
Dim slope As Double
Dim samplestartdist As Double
Dim sampledist As Double
Dim rwoffset As Double
Dim offsetelevdist As Double
Dim offsetelev As Double
slope = 1 / 34
offsetelevdist = 100
offsetelev = (slope * offsetelevdist) + elevDsection
samplestartdist = 0
sampledist = 500 + offsetelevdist
rwoffset = 0
rwoffset = rwoffset
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.HorizontalScrollbar = False
Do While sampledist > 0
ListBox1.Items.Add(rwoffset)
rwoffset = rwoffset + offsetelevdist
sampledist = sampledist - offsetelevdist
offsetelev = (slope * rwoffset) + elevDsection
Loop
end sub