How to make at panel couple pictures to one - c#

I need to make 4 different images in one, and it will be in the panel. Panel size will vary from 180 to 320. I tried to do one main panel, and in her place 4, which are fixed by anchors...
What I have (source four pics)
What i need to get. Panel like this
What I got
private void Form1_Load(object sender, EventArgs e)
{
Panel main_panel = new Panel();
main_panel.BackColor = Color.Azure;
Panel panel_top_left = new Panel();
Panel panel_top_right = new Panel();
Panel panel_bottom_left = new Panel();
Panel panel_bottom_right = new Panel();
Bitmap btm_msg_panel_top_left = new Bitmap(Properties.Resources.blue_t_l);
panel_top_left.BackgroundImage = btm_msg_panel_top_left;
Bitmap btm_msg_panel_top_right = new Bitmap(Properties.Resources.blue_t_r);
panel_top_right.BackgroundImage = btm_msg_panel_top_right;
Bitmap btm_msg_panel_bottom_left = new Bitmap(Properties.Resources.blue_b_l);
panel_bottom_left.BackgroundImage = btm_msg_panel_bottom_left;
Bitmap btm_msg_panel_bottom_right = new Bitmap(Properties.Resources.blue_b_r);
panel_bottom_right.BackgroundImage = btm_msg_panel_bottom_right;
main_panel.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
panel_top_left.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
panel_top_right.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left;
panel_bottom_left.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
panel_bottom_right.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
main_panel.Controls.Add(panel_top_left);
main_panel.Controls.Add(panel_top_right);
main_panel.Controls.Add(panel_bottom_left);
main_panel.Controls.Add(panel_bottom_right);
panel1.Controls.Add(main_panel);
}

Well... I will answer on my own post :))
private void Form1_Load(object sender, EventArgs e)
{
Panel panel_top_left = new Panel();
Panel panel_top_right = new Panel();
Panel panel_bottom_left = new Panel();
Panel panel_bottom_right = new Panel();
Bitmap btm_msg_panel_top_left = new Bitmap(Properties.Resources.blue_t_l);
panel_top_left.BackgroundImage = btm_msg_panel_top_left;
Bitmap btm_msg_panel_top_right = new Bitmap(Properties.Resources.blue_t_r);
panel_top_right.BackgroundImage = btm_msg_panel_top_right;
Bitmap btm_msg_panel_bottom_left = new Bitmap(Properties.Resources.blue_b_l);
panel_bottom_left.BackgroundImage = btm_msg_panel_bottom_left;
Bitmap btm_msg_panel_bottom_right = new Bitmap(Properties.Resources.blue_b_r);
panel_bottom_right.BackgroundImage = btm_msg_panel_bottom_right;
panel_top_left.Width = btm_msg_panel_top_left.Width;
panel_top_right.Width = btm_msg_panel_top_right.Width;
panel_bottom_left.Height = btm_msg_panel_bottom_left.Height;
panel_bottom_left.Width = btm_msg_panel_bottom_left.Width;
panel_bottom_right.Height = btm_msg_panel_bottom_right.Height;
panel_bottom_right.Width = btm_msg_panel_bottom_right.Width;
panel_top_right.Location = new Point(panel_top_left.Width - panel_top_right.Width, 0);
panel_bottom_left.Location = new Point(0, panel_top_left.Height - panel_bottom_left.Height);
panel_bottom_right.Location = new Point(panel_top_left.Width - panel_bottom_right.Width, panel_top_left.Height - panel_bottom_right.Height);
panel1.Controls.Add(panel_bottom_right);
panel1.Controls.Add(panel_top_right);
panel1.Controls.Add(panel_bottom_left);
panel1.Controls.Add(panel_top_left);
}
This is result

See if this helps;
private void Form1_Load(object sender, EventArgs e)
{
Panel main_panel = new Panel();
main_panel.BackColor = Color.Azure;
Panel panel_top_left = new Panel();
Panel panel_top_right = new Panel();
Panel panel_bottom_left = new Panel();
Panel panel_bottom_right = new Panel();
Bitmap btm_msg_panel_top_left = new Bitmap(Properties.Resources.blue_t_l);
panel_top_left.BackgroundImage = btm_msg_panel_top_left;
Bitmap btm_msg_panel_top_right = new Bitmap(Properties.Resources.blue_t_l);
panel_top_right.BackgroundImage = btm_msg_panel_top_right;
Bitmap btm_msg_panel_bottom_left = new Bitmap(Properties.Resources.blue_t_l);
panel_bottom_left.BackgroundImage = btm_msg_panel_bottom_left;
Bitmap btm_msg_panel_bottom_right = new Bitmap(Properties.Resources.blue_t_l);
panel_bottom_right.BackgroundImage = btm_msg_panel_bottom_right;
main_panel.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
panel_top_left.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
panel_top_right.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
panel_bottom_left.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
panel_bottom_right.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left;
main_panel.Controls.Add(panel_top_left);
main_panel.Controls.Add(panel_top_right);
main_panel.Controls.Add(panel_bottom_left);
main_panel.Controls.Add(panel_bottom_right);
panel1.Controls.Add(main_panel);
}

Related

Setting anchor for dynamic created controls

I have winform on which are dynamically created 52 radio buttons.
This is method for creating them:
private void CreateRadioButton()
{
int rbCount = 52;
int numberOfColumns = 23;
radioButtons = new RadioButton[rbCount];
int y = 520;
for (int i = 0; i < rbCount; i++)
{
radioButtons[i] = new RadioButton();
radioButtons[i].Text = Convert.ToString(i + 1);
if (i % numberOfColumns == 0)
y += 20;
var x = 11 + i % numberOfColumns * 50;
radioButtons[i].Location = new Point(x, y);
radioButtons[i].Size = new Size(40, 15);
//radioButtons[i].Anchor = AnchorStyles.Left;
//radioButtons[i].Anchor = AnchorStyles.Bottom;
radioButtons[i].Font = new Font(radioButtons[i].Font.FontFamily, 8, FontStyle.Bold);
radioButtons[i].UseVisualStyleBackColor = true;
radioButtons[i].Click += new EventHandler(rbtns_click);
xtraTab.Controls.Add(radioButtons[i]);
}
}
There is problem when form is maximized. Radio buttons disappear.
If I set
radioButtons[i].Anchor = AnchorStyles.Left;
radioButtons[i].Anchor = AnchorStyles.Bottom;
The radio buttons are overlayed.
What can I do to keep their position on the same place if form is resized?
these two lines
radioButtons[i].Anchor = AnchorStyles.Left;
radioButtons[i].Anchor = AnchorStyles.Bottom;
mean that Anchor value AnchorStyles.Left will be replaced by AnchorStyles.Bottom
AnchorStyles has Flags attribute set, enum values can be combined:
radioButtons[i].Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
if set via Designer, in "Windows Form Designer generated code" it looks like this:
this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)
((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));

Dynamically added winforms control Not displaying?

I have this custom control which is basically a panel:
class ResultPanel : Panel {
Label scoreValueLabel = new Label();
public ResultPanel() : base(){
scoreValueLabel.AutoSize = true;
scoreValueLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
scoreValueLabel.Location = new System.Drawing.Point(265, 99);
scoreValueLabel.Name = "scoreValueLabel";
scoreValueLabel.Size = new System.Drawing.Size(49, 25);
scoreValueLabel.TabIndex = 10;
scoreValueLabel.Text = "+10";
Controls.Add(scoreValueLabel);
}
}
And I'm trying to add it to a panel in an event handler:
private void ResultsReceivedHandler(object sender, List<QuestionResult> results) {
ResultPanel resultPanel = new ResultPanel();
allResultsPanel.Controls.Add(new ResultPanel());
resultPanel.Anchor = ((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right);
resultPanel.BorderStyle = BorderStyle.FixedSingle;
resultPanel.Location = new Point(0, 155);
resultPanel.Name = "questionResultPanel";
resultPanel.Size = new Size(325, 148);
resultPanel.TabIndex = 0;
}
I know that an instance of ResultPanel can be displayed in allResultsPanel because I have added(using designer view) a ResultPanel to allResultsPanel that has the same size as this one at the top of allResultsPanel and that displays.
allResultsPanel is just a normal Panel btw, and its big enough to fit the control because its height is 800.
So why can i see the control added through the design view but not one added dynamically?
While setting up resultPanel:
ResultPanel resultPanel = new ResultPanel();
resultPanel.Anchor = ((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right);
resultPanel.BorderStyle = BorderStyle.FixedSingle;
resultPanel.Location = new Point(0, 155);
resultPanel.Name = "questionResultPanel";
resultPanel.Size = new Size(325, 148);
resultPanel.TabIndex = 0;
You are adding another new panel to the allResultsPanel
allResultsPanel.Controls.Add(new ResultPanel());

blinking panels with pictures by adding a few more

i have little app where I have one panel containing 6 more panels (inside this panels pictures), and when i click on the button, botton this panel dynamically created couple panels, and when panels create whole this panels are blinking... it's looks not good... please, tell me, what to do?
a cycle where I created the panel, clicking on a button to created panel adds the same number of panels
for (int i = 0; i < list_afy_add.Count; i++)
{
Panel main_panel = new Panel();
main_panel.Name = i.ToString();
main_panel.Width = 308;
main_panel.BackColor = Color.Transparent;
main_panel.Location = new Point(x, y);
Panel panel = new Panel();
panel.Name = i.ToString();
panel.MouseEnter += new EventHandler(panel_MouseEnter);
panel.Width = 300;
panel.Location = new Point(3, 5);
Label textBox_date = new Label();
panel.Controls.Add(textBox_date);
textBox_date.Name = "textBox_date" + i.ToString();
textBox_date.Location = new Point(220, 8);
textBox_date.Size = new System.Drawing.Size(70, 15);
textBox_date.BorderStyle = BorderStyle.None;
textBox_date.MinimumSize = new System.Drawing.Size(72, 15);
textBox_date.TextAlign = ContentAlignment.MiddleRight;
textBox_date.BackColor = Color.FromArgb(((int)(((byte)(203)))), ((int)(((byte)(208)))), ((int)(((byte)(217)))));
textBox_date.Anchor = AnchorStyles.Right | AnchorStyles.Top;
textBox_date.ForeColor = SystemColors.InactiveCaption;
Label textBox_name = new Label();
panel.Controls.Add(textBox_name);
textBox_name.Size = new System.Drawing.Size(100, 15);
textBox_name.MinimumSize = new System.Drawing.Size(100, 15);
textBox_name.Location = new Point(5, 8);
textBox_name.BorderStyle = BorderStyle.None;
textBox_name.BackColor = Color.FromArgb(((int)(((byte)(203)))), ((int)(((byte)(208)))), ((int)(((byte)(217)))));
textBox_name.ForeColor = SystemColors.InactiveCaption;
Label textBox_msg = new Label();
panel.Controls.Add(textBox_msg);
textBox_msg.Location = new Point(5, 30);
textBox_msg.Name = i.ToString();
textBox_msg.Tag = list_afy_add[i]._AddEventNotification.eventNotificationId;
textBox_msg.BorderStyle = BorderStyle.None;
textBox_msg.BackColor = Color.FromArgb(((int)(((byte)(203)))), ((int)(((byte)(208)))), ((int)(((byte)(217)))));
textBox_msg.ForeColor = SystemColors.Highlight;
textBox_msg.Cursor = Cursors.Arrow;
textBox_msg.MaximumSize = new System.Drawing.Size(280, 100);
textBox_msg.MinimumSize = new System.Drawing.Size(280, 14);
textBox_msg.AutoSize = true;
textBox_msg.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
Label labelOpenChat = new Label();
labelOpenChat.Size = new System.Drawing.Size(90, 15);
labelOpenChat.Text = "Открыть чат";
labelOpenChat.Font = new Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(200)));
labelOpenChat.Location = new Point(10, 8);
labelOpenChat.BorderStyle = BorderStyle.None;
labelOpenChat.BackColor = Color.FromArgb(((int)(((byte)(203)))), ((int)(((byte)(208)))), ((int)(((byte)(217)))));
labelOpenChat.ForeColor = SystemColors.InactiveCaption;
panel.Controls.Add(labelOpenChat);
main_panel.Controls.Add(panel);
panel1.Controls.Add(main_panel);
panel.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
main_panel.Dock = DockStyle.Top;
date_and_msg_check(list_afy_add[i]._AddEventNotification.eventNotificationName, list_afy_add[i]._AddEventNotification.eventNotificationDate, list_afy_add[i]._AddEventNotification.eventNotificationMsg);
textBox_name.Text = valForName;
textBox_date.Text = valForDate;
textBox_msg.Text = valForMsg;
int height = textBox_msg.Size.Height + textBox_name.Height + 19;
panel.Height = height;
main_panel.Height = height + 10;
int panHei = panel.Height;
/*--------------------------------*/
Panel panel_top_left = new Panel();
Panel panel_top_right = new Panel();
Panel panel_bottom_left = new Panel();
Panel panel_bottom_right = new Panel();
Bitmap btm_msg_panel_top_left = new Bitmap(Properties.Resources.blue_t_l1);
panel_top_left.BackgroundImage = btm_msg_panel_top_left;
Bitmap btm_msg_panel_top_right = new Bitmap(Properties.Resources.blue_t_r);
panel_top_right.BackgroundImage = btm_msg_panel_top_right;
Bitmap btm_msg_panel_bottom_left = new Bitmap(Properties.Resources.blue_b_l);
panel_bottom_left.BackgroundImage = btm_msg_panel_bottom_left;
Bitmap btm_msg_panel_bottom_right = new Bitmap(Properties.Resources.blue_b_r);
panel_bottom_right.BackgroundImage = btm_msg_panel_bottom_right;
panel_top_left.Width = panel.Width;
panel_top_left.Height = height + 2;
panel_top_right.Width = btm_msg_panel_top_right.Width;
panel_bottom_left.Height = btm_msg_panel_bottom_left.Height;
panel_bottom_left.Width = btm_msg_panel_bottom_left.Width;
panel_bottom_right.Height = btm_msg_panel_bottom_right.Height;
panel_bottom_right.Width = btm_msg_panel_bottom_right.Width;
panel_top_right.Location = new Point(panel_top_left.Width - 4, 0);
panel_bottom_left.Location = new Point(0, panel_top_left.Height - panel_bottom_left.Height);
panel_bottom_right.Location = new Point(panel_top_left.Width - 4, panel_top_left.Height - panel_bottom_right.Height);
panel_top_right.Anchor = AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
panel_bottom_right.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
panel_bottom_left.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
panel_top_left.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
/*--------------------------------*/
Button delButt = new Button();
delButt.Name = list_afy_add[i]._AddEventNotification.eventNotificationId;
delButt.Click += new EventHandler(delButt_Click);
delButt.Size = new System.Drawing.Size(12, 12);
delButt.Location = new Point(292, 6);
delButt.Anchor = AnchorStyles.Right | AnchorStyles.Top;
delButt.BackColor = Color.Transparent;
delButt.FlatStyle = FlatStyle.Flat;
delButt.FlatAppearance.BorderSize = 0;
delButt.FlatAppearance.MouseDownBackColor = Color.Transparent;
delButt.FlatAppearance.MouseOverBackColor = Color.Transparent;
delButt.BackgroundImage = bmp_close_normal;
panel_top_left.Controls.Add(delButt);
delButt.Hide();
panel.Controls.Add(panel_bottom_right);
panel.Controls.Add(panel_top_right);
panel.Controls.Add(panel_bottom_left);
panel.Controls.Add(panel_top_left);
}
You can try using Reflection to set DoubleBuffered to true for all your panels like this:
public static class PanelExtensions {
public static void EnableDoubleBuffered(this Panel panel){
typeof(Panel).GetProperty("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(panel, true, null);
}
}
//Use it
yourPanel.EnableDoubleBuffered();
NOTE: I'm not sure if this works, just post here to help you try some approach which can solve your problem, otherwise I have no idea to make it better and will remove this answer.
Try to use the Control's SuspendLayout() method before adding the child controls, and don't forget to call the ResumeLayout() after you have finished. This should help to reduce or eliminate the blinking.

How to scroll in TabPages/TabControl

I've tabcontrol with 3 pages. Within the tabpages are placed listviews. The listviews can be bigger than the tabpage itself.
I wanna add scrollbars on the tabpages
I tried to solve this with the following source:
lvwAlbums.Parent = pctlDatabeheer.TabPages[1];
lvwAlbums.Left = 0;
lvwAlbums.Top = 0;
lvwAlbums.Width = pctlDatabeheer.TabPages[1].Width - 35;
lvwAlbums.Height = 1000;// pctlDatabeheer.TabPages[1].Height;
lvwAlbums.SmallImageList = iltListView;
lvwAlbums.FullRowSelect = true;
lvwAlbums.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
foreach (TabPage _Page in pctlDatabeheer.TabPages)
{
_Page.AutoScroll = true;
_Page.AutoScrollMargin = new System.Drawing.Size(20, 20);
_Page.AutoScrollMinSize = new System.Drawing.Size(_Page.Width, _Page.Height);
}
But the scroll are not shown. What do I wrong?
Can anybody help me?
Thank yopu for your help.
I created a new Visual Studio WinForms project. Kept the form designer completely empty and used your code:
public Form1()
{
InitializeComponent();
// Make TabControl
TabControl tabControl1 = new TabControl();
tabControl1.TabPages.Add(new TabPage());
tabControl1.TabPages.Add(new TabPage());
tabControl1.Dock = DockStyle.Fill;
this.Controls.Add(tabControl1);
// Make long ListView and add to first tab
ListView listView1 = new ListView();
listView1.Location = new Point(0, 0);
listView1.Height = 1000;
tabControl1.TabPages[0].Controls.Add(listView1);
// Your code
foreach (TabPage _Page in tabControl1.TabPages)
{
_Page.AutoScroll = true;
_Page.AutoScrollMargin = new System.Drawing.Size(20, 20);
_Page.AutoScrollMinSize = new System.Drawing.Size(_Page.Width, _Page.Height);
}
}
Works perfectly fine. I suspect you have something else wrong but I can't see that or troubleshoot it without seeing your code.
EDIT: Now that you posted some more code, your issue is with your list box:
lvwAlbums.Parent = pctlDatabeheer.TabPages[1];
lvwAlbums.Left = 0;
lvwAlbums.Top = 0;
lvwAlbums.Width = pctlDatabeheer.TabPages[1].Width - 35;
lvwAlbums.Height = 1000;
lvwAlbums.SmallImageList = iltListView;
lvwAlbums.FullRowSelect = true;
// Here is the issue!
// Do not anchor to the bottom or scrolling won't work
lvwAlbums.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
Don't anchor the control to the bottom. That is causing you the issue. You cannot anchor to the bottom and then scroll. The other anchors are fine.

keep button position on panel resize

I've been messing around with something that should be simple.
I've moved jobs and trying to get some of the basic tools I have used before, but of course I don't have the old source to look at.
We had extended panel to have some standard properties and functions (save, close, save and close).
But I can't get the buttons to be positioned correctly on a resize. I put this ExtPanel on a form but the buttons keep disappearing as I resize, or don't move as expected (frozen on bottom right).
The class
public partial class ExtPanel: UserControl
{
private System.Windows.Forms.Button btnSaveandClose;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnSave;
public ExtPanel ()
{
InitializeComponent ();
}
// misc things this class does...
}
public partial class ExtPanel
{
private void InitializeComponent ()
{
this.btnSaveandClose = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// btnSaveandClose
//
this.btnSaveandClose.Location = new System.Drawing.Point(899, 689);
this.btnSaveandClose.Name = "btnSaveandClose";
this.btnSaveandClose.Size = new System.Drawing.Size(100, 30);
this.btnSaveandClose.TabIndex = 0;
this.btnSaveandClose.Text = "Save and Close";
this.btnSaveandClose.UseVisualStyleBackColor = true;
this.btnSaveandClose.Click += new System.EventHandler(this.Click_SaveandClose);
this.btnSaveandClose.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(687, 689);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(100, 30);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.Click_Close);
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(793, 689);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(100, 30);
this.btnSave.TabIndex = 2;
this.btnSave.Text = "Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.Click_Save);
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.btnSave);
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Controls.Add(this.btnSaveandClose);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1008, 730);
this.panel1.TabIndex = 0;
//
// ExtPanel
//
this.Controls.Add(this.panel1);
this.Name = "ExtPanel";
this.Size = this.panel1.Size;
this.Click += new System.EventHandler(this.click_this);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
}
Have you tried anchoring the button?
...I missed the anchoring code.
If you have a button in the lower right-hand corner that you want to stay in the lower right-hand corner when resizing the form, set it's anchor properties to Bottom, Right.
Update:
I loaded your code. You have a panel inside of ExtPanel. If you dock (Fill) that panel then you should be working fine by resizing ExtPanel.

Categories