473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Multiple display of panel on the click of a buttton

Hi

I have a panel control in Winform, on the panel I have few controls like datecontrol, textbox,combobox. When I click on a button callled add I want to display the panel. I used the following code.Its working fine.
Expand|Select|Wrap|Line Numbers
  1. private void add_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.             panel3.Visible = true;
  5.  
  6.         }
  7.  
Now if I click the Add button again I want the panel to appear one more time on the form.I mean mutliple click to add button should display the same panel serveral times. How do I do this.
Feb 11 '09 #1
1 3269
tlhintoq
3,525 Expert 2GB
You will have to create a new panel each time you click the button, instead of just showing a hidden panel created at design time. Of course you will have to work out the location of the new panel so it doesn't wind up under pre-existing controls.

Expand|Select|Wrap|Line Numbers
  1.             Panel AnotherPanel = new Panel();
  2.             AnotherPanel.Width = 100;
  3.             AnotherPanel.Height = 100;
  4.             AnotherPanel.BackColor = Color.Red;
  5.             AnotherPanel.Location = new Point (50,50);
  6.             this.Controls.Add(AnotherPanel);
  7.             AnotherPanel.Show();
  8.  
Feb 11 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. ...
3
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on...
2
by: Darren Carter | last post by:
Hi, I have mutliple asp:Panel controls on a single page, each with a default button defined (each default button resides within its respective asp:Panel). All validation controls and buttons...
3
by: Bill Nguyen | last post by:
I'm working on a project that requires outputs to be sent to multiple windows on a single monitor. I have no idea whether .NET can provide this capability. Also, is there any utility/control out...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
7
by: flashguy | last post by:
Hi, Looking online for this related topic that will be exclusively used for MS ACCESS (2000 preferably) is extremely limited. Is it possible to add Multiple records with one click of a buttton...
4
by: tudyfruity18 | last post by:
I'm suppose to write an applet that contains two buttons Investment calculator and Loan Calculator. When the Investment Calculator button is clicked, a frame appears in a new window for calculating...
0
by: chandan | last post by:
Hi, On Update panel there are two control Button and TextBox.On click on Buttton I make visible true to textBox.TextBox shown on the page but on source code ther is no any html code for this...
0
by: chandan kumar | last post by:
Hi, On Update panel there are two control Button and TextBox.On click on Buttton I make visible true to textBox.TextBox shown on the page but on source code ther is no any html code for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.