From: giminera on
In a form I have a VScrollBar (bar1) and a FlowLayoutPanel (panel1)
I'm going to fill with buttons that correspond to data in a table in a
dataset (button and ds.Tables (1)). I wish I could disable the display
of the scrollbars FlowLayoutPanel but use the VScrollBar. Right now
they are only able to operate in parallel with the vertical scroll bar
of the combine and FlowLayoutPanel VScrollBar making them inherit the
values from the scroll inside the control FlowLayoutPanel. Thank
anyone can give me a solution. Basically I want to avoid the
AutoScroll but manage with a vertical scroll bar independent
Attached below the code for filling the FlowLayoutPanel.

Dim con As New OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =
sql = "SELECT * FROM portate WHERE tipo = 0"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "portate")
Dim intIndex As Integer
For intIndex = 0 To ds.Tables(0).Rows.Count - 1
Dim bottone As New Button
With bottone
..Size = New Size(103, 80)
..FlatStyle = FlatStyle.Standard
..Text = ds.Tables(0).Rows(intIndex).Item(0)
..ForeColor = Color.White
'.ImageList = ImageList1
'.ImageIndex = 0
'.BackColor = Color.Aqua
AddHandler bottone.Click, AddressOf btn_Click
End With
Flow1.AutoScroll = True
Bar1.LargeChange = Flow1.VerticalScroll.LargeChange
Bar1.SmallChange = Flow1.VerticalScroll.SmallChange
Bar1.Maximum = Flow1.VerticalScroll.Maximum
Catch es As Exception
End Try
Pages: 1
Prev: Shared Sub Main
Next: Update Access