G
Guest
Hi,all.
It is so stupid question.
I want to add a vertical scroll bar to my form, but I can not.
On my Form: I add a Panel, and add my VScrollbar to Panel
or directly add VScrollbar to Form
Both of them do not work.
My source is below:
public calss myFrom:From
{
private TabControl pageTabControl;
private Panel tabPanel;
private VScrollBar vs;
public myForm
{
pageTabControl = new TabControl();
tabPanel = new Panel();
vs = new VScrollBar();
vs.Maximum = 1000;
vs.Minimum = 0;
vs.Location = new Point(10, 10);
vs.Enabled = true;
vs.Width = 12;
InitializeComponent();
tabPanel.Controls.Add(pageTabControl);
tabPanel.Controls.Add(vs);
//this.Controls.Add(vs);
this.Controls.Add(tabPanel);
}
private void InitializeComponent()
{
...
...
DisplayForm()
...
...
}
private void DisplayForm()
{
TabPage tp = new TabPage();
Panel sPanel = new Panel();
sPanel .Controls.Add(new CheckBox());
tp.Controls.Add(sPanel);
pageTabControl.Controls.Add(tp);
tp = new TabPage();
sPanel = new Panel();
sPanel.COntrols.Add(new RadioBox());
tp.Controls.Add(sPanel);
pageTabControl.Controls.Add(tp);
}
}
thanks.
It is so stupid question.
I want to add a vertical scroll bar to my form, but I can not.
On my Form: I add a Panel, and add my VScrollbar to Panel
or directly add VScrollbar to Form
Both of them do not work.
My source is below:
public calss myFrom:From
{
private TabControl pageTabControl;
private Panel tabPanel;
private VScrollBar vs;
public myForm
{
pageTabControl = new TabControl();
tabPanel = new Panel();
vs = new VScrollBar();
vs.Maximum = 1000;
vs.Minimum = 0;
vs.Location = new Point(10, 10);
vs.Enabled = true;
vs.Width = 12;
InitializeComponent();
tabPanel.Controls.Add(pageTabControl);
tabPanel.Controls.Add(vs);
//this.Controls.Add(vs);
this.Controls.Add(tabPanel);
}
private void InitializeComponent()
{
...
...
DisplayForm()
...
...
}
private void DisplayForm()
{
TabPage tp = new TabPage();
Panel sPanel = new Panel();
sPanel .Controls.Add(new CheckBox());
tp.Controls.Add(sPanel);
pageTabControl.Controls.Add(tp);
tp = new TabPage();
sPanel = new Panel();
sPanel.COntrols.Add(new RadioBox());
tp.Controls.Add(sPanel);
pageTabControl.Controls.Add(tp);
}
}
thanks.