473,395 Members | 1,558 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,395 software developers and data experts.

to copy a groupbox to another form.

JuniorDevelopment
Hello i have a Form which contains a groupbox with several labels.
After a click a new form opens with a groupbox as parameter..
But when i close that form the groupbox on original form has disapeared.

It happens at Controls.Add(Detail).. apperently its not the right way or any help would be appreciated.

code:

private void lnklblToeslagen_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{

GroupBox gb = gbToeslag;
DetailForm df = new DetailForm(gb);
df.Show();
}

public partial class DetailForm : Form
{
public DetailForm(GroupBox Detail)
{
InitializeComponent();
Detail.Controls.Add(Detail);
Detail.Location = new Point(20, 30);
this.Size = Detail.Size;
this.Width +=40;
this.Height += 60;
}
Jan 19 '10 #1
2 3344
NitinSawant
270 100+
you need to pass a copy of the groupbox object i.e. create new groupbox having same properties.

chk out:
http://nitin646.wordpress.com/2009/1...n-object-in-c/


Regards,
Nitin Sawant
Jan 19 '10 #2
Thanks NitinSawant, but I get an exception on serialize.
It keeps telling me its not marked as serialize.
I checked internet but whatever i tried i still got the exception.

Greets,
Jasper
Jan 20 '10 #3

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

Similar topics

3
by: Mr.Clean | last post by:
I am trying to mimic a Windows GroupBox control using fieldset, label and radio buttons. The problem lies in that I can not correctly do the radio buttons relative to the groupbox and the label...
0
by: Mark Johnson | last post by:
Sometimes Controls that have been added to a GroupBox do not show up. What I am doing : 1) I am not using the designer, but create all the Controls per hand: groupBoxProdukt_01 = new...
0
by: Renee | last post by:
Hi there, does any one know how to create context sensitive help for Groupbox control with HelpProvider class? I can create context sensitive help for any control easily except for Groupbox. ...
2
by: Serge | last post by:
Hi, in my windows.forms application I have added a goupBox control to my windows.form. Now I want to know the x,y-position from the mouse cursor when I click on the groupBox. The strange thing...
0
by: Peter | last post by:
When my form loads I have 3 items perfectly aligned: '________________________________________________________ (Width, Height) Startup form name is "strForm" (w800, h570) Location(0, 0)...
8
by: johnmmcparland | last post by:
Hi all, my program is trying to add group boxes with radio buttons at run time. While at one point it was able to draw the group boxes without the radio buttons, now it encounters problems just...
0
by: Rich | last post by:
Hello, I have a form that contains some textboxes and a couple of groupboxes that contain some radiobuttons. I have set the tabstop to false for all the radiobuttions. When the form originally...
2
by: Saranya | last post by:
hi friends i want to perform a similar control as that of a group box in my web application.i m not at all comfortable with panel,html grid layout how to achieve this plz tell
3
by: =?Utf-8?B?RG91Z0U=?= | last post by:
Yes the groupbox is enabled and the checkbox is enabled. Using the click event does nothing to fire checkbox1.enable = false. the checkbox remains enabled, and the user can uncheck it. This is...
4
by: Gugale at Lincoln | last post by:
Hi, I am using reflection to read names from enum and creating radio buttons inside a groupbox. Everything is working fine. However, I am not able to adjust the size of the group box to fit the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.