473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

designer serialization

22 New Member
Hi all,
i have a form with 3 textboxes and i have a class named user which has 3 members such as name, surname and age. I use the form to get user values design time and i want to serialize these values into the form designer. I can show the form at design time by using a ComponentDesigner. Here is a part of my code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. public class MyDesigner : ComponentDesigner
  3.     {
  4.         MyComponent CurrentController
  5.         {
  6.             get { return (MyComponent)this.Component; }
  7.         }
  8.         private DesignerVerbCollection actions;
  9.         public override DesignerVerbCollection Verbs
  10.         {
  11.             get
  12.             {
  13.                 if(actions == null)
  14.                 {
  15.                     actions = new DesignerVerbCollection();
  16.                     actions.Add(new DesignerVerb("EditorForm", new EventHandler(ChangeDisplay)));
  17.  
  18.                 }
  19.                 return actions;
  20.             }
  21.         }
  22.  
  23.                  }
  24.  
  25.             void ChangeDisplay(object sender, EventArgs e)
  26.            {
  27.             EditorForm editor = new EditorForm(this);
  28.             editor.ShowDialog();
  29.            }
  30. }
  31.  
I also have a collection class which i hold user class members. What i need is to serialize the collection into designer at design time. I can serialize the values by using the collectioneditor but can't do that via my editor form.
Any help would be greatly appreciated.
Sep 26 '08 #1
2 1509
nateraaaa
663 Recognized Expert Contributor
Have you tried adding the Serializable attribute to the Component class.

Expand|Select|Wrap|Line Numbers
  1. <Serializable()>
  2. Public Class User()
This site may help you
http://www.vbdotnetheaven.com/UploadFile/ddutta/AttributesProgramming04112005061709AM/AttributesProgramming.aspx
Sep 26 '08 #2
blackirish
22 New Member
Have you tried adding the Serializable attribute to the Component class.

Expand|Select|Wrap|Line Numbers
  1. <Serializable()>
  2. Public Class User()
This site may help you
http://www.vbdotnetheaven.com/UploadFile/ddutta/AttributesProgramming04112005061709AM/AttributesProgramming.aspx
Thanks for the reply nateraaaa. I tried it but it makes no difference. Moreover i can already serialize the form members via the custom collection editor which is displayed in the property grid when the component is selected. I just want to know how to serialize these values over the editor form i created.
Sep 27 '08 #3

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

Similar topics

11
6552
by: Daniel Billingsley | last post by:
I've got a project I've been working on for a few weeks. I've been using the BindingSource control - I've got four of them on this particular form. This morning I went to view the report in the...
2
10755
by: Richard Bysouth | last post by:
Hi When attempting to view inherited forms in design mode I have been getting the message "The path is not of a legal form" and am unable to view the designer. I can't seem to find any...
0
1365
by: Adam Right | last post by:
Hi, I am using contextmenustrip in my usercontrol in which there is a grid control associated with it. I added the rows below in the designer code, to create contextmenustrip with its...
0
1246
by: Bruce HS | last post by:
In VS2005, VB 2005, I suddenly can't get at a winform design view. The application still runs OK, but I can't see the designer. I'ver rebuilt the solution with no success. I'm looking for a...
1
4667
by: dusanv | last post by:
Hi, I have a class (say O1) that overrides System::Windows::Forms::UserControl and then another one that overrides O1 (call it O2). O2 used to work with the Designer as it was inheriting...
5
2922
by: Alan T | last post by:
I got this kind of error recently: When I tried to open a form I got error something like this: One of more errors encountered while loading the designer. The errors are listed below. Some...
4
5798
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
1
3270
by: =?Utf-8?B?RjVGNUY1?= | last post by:
I have created a control by inheriting ToolStripMenuItem that has an image property called LargeImage. ------ public class EventSubMenuItem : ToolStripMenuItem { private Image _largeImage =...
6
3320
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem...
3
2243
by: steve | last post by:
VS designer has started to complain about the following errors : Object reference not set to an instance of an object. Instances of this error (2) and Index was out of range. Must be...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
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...
1
7039
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
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.