473,665 Members | 2,798 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 ComponentDesign er. 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 collectionedito r but can't do that via my editor form.
Any help would be greatly appreciated.
Sep 26 '08 #1
2 1517
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.vbdotnethea ven.com/UploadFile/ddutta/AttributesProgr amming041120050 61709AM/AttributesProgr amming.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.vbdotnethea ven.com/UploadFile/ddutta/AttributesProgr amming041120050 61709AM/AttributesProgr amming.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
6563
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 designer and got: Could not find type 'LandarcBL.Budget'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built....
2
10766
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 further information on this error - does anyone know what the problem and resolution might be? thanks
0
1376
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 constructor which takes the "IContainer" parameter. "this.m_Components" is defined in my base usercontrol as a protected member. My code is below in my designer:
0
1258
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 general strategy for dealing with this problem. Here is the error text: Object reference not set to an instance of an object.
1
4678
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 directly from UserControl (and was created using the wizard) but since I inserted O1 into inheritance tree (without resx, straight override) I get the error pasted at the bottom when trying to open O2 in Designer. I deleted the NCB file to no avail....
5
2928
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 errors can be fixed by rebuilding your project, while others may require code changes. Look at the lines all are referencing the system things such as at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark)
4
5822
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 the resizing tool (in the designer) is offset both horizontally and vertically and when I put a control on it, as soon as I save, the designer throws an exception (but cannot be reproduced everytime) and the form cannot be loaded anymore unless...
1
3295
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 = null;
6
3336
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 I discovered first a workaround, then the real cause of the problem. I would like to understand why what I am doing is frowned upon by Visual Studio and how to do this properly. My application is in one solution; supporting libraries including...
3
2249
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 non-negative and less than the size of the collection. Parameter name: index Instances of this error (12)
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5660
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.