Hello,
I'm trying to save some properties of some windows controls into a XML File.
Most of the properties work when I save them as String
(TypeConverter. ConvertToString ). But some complex properties like image,
collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex properties?
Thanks in advance...
Regards,
Özden 4 1383
Ozden,
I would try and use serialization to do this. You can use a
SoapFormatter to do this. The drawback to this is that the object has to be
marked as serialized. If this is not the case, you can try and use the
XmlFormatter. The drawback to this though is that it will only serialize
public properties, and some objects can not have their state fully restored
by just having the public properties set. For example, image data isn't
exposed publically (the raw bytes).
In these cases, you are going to have to serialize the data yourself in
some manner.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Özden Irmak" <oz********@isn et.net.tr> wrote in message
news:up******** ******@TK2MSFTN GP12.phx.gbl... Hello,
I'm trying to save some properties of some windows controls into a XML
File. Most of the properties work when I save them as String (TypeConverter. ConvertToString ). But some complex properties like image, collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex
properties? Thanks in advance...
Regards,
Özden
Hi,
Image for example support ISerializable so it should be easy to serialize
it.
The problem are controls that do not support ISerializable , in fact all
controls has MarshalByRefObj ect in the inheritance line so they are not
serializables, you will have to do a custom serialization for them.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Özden Irmak" <oz********@isn et.net.tr> wrote in message
news:up******** ******@TK2MSFTN GP12.phx.gbl... Hello,
I'm trying to save some properties of some windows controls into a XML
File. Most of the properties work when I save them as String (TypeConverter. ConvertToString ). But some complex properties like image, collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex
properties? Thanks in advance...
Regards,
Özden
Hi Ozden,
Why do you not just look to the RESX files which are created when you use
the designer with VB.net forms and/or C# forms.
You have to open it and than look to it in the XML view.
If you use the imagelist from the designer on your form with some pics in it
you see also images
I hope this helps?
Cor I'm trying to save some properties of some windows controls into a XML
File. Most of the properties work when I save them as String (TypeConverter. ConvertToString ). But some complex properties like image, collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex
properties? Thanks in advance...
Regards,
Özden
Hello,
Thank you all for your great advices...
Regards,
Özden
"Cor" <no*@non.com> wrote in message
news:et******** ******@TK2MSFTN GP12.phx.gbl... Hi Ozden,
Why do you not just look to the RESX files which are created when you use the designer with VB.net forms and/or C# forms.
You have to open it and than look to it in the XML view.
If you use the imagelist from the designer on your form with some pics in
it you see also images
I hope this helps?
Cor
I'm trying to save some properties of some windows controls into a XML File. Most of the properties work when I save them as String (TypeConverter. ConvertToString ). But some complex properties like image, collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex
properties? Thanks in advance...
Regards,
Özden
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Michael Kennedy [UB] |
last post by:
Hi Everyone,
I have this multithreaded C# windows forms application which does a lot of
image processing. Occasionally, I get the following error:
A generic error occurred in GDI+.
System.Runtime.InteropServices.ExternalException: A generic error occurred
in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder,
EncoderParameters encoderParams)
|
by: Sunny |
last post by:
Hi,
I have an old problem which I couldn't solve so far. Now I have found a post
in that group that gave me an idea, but I can not fully understand it.
The problem is: I'm trying to use a Windows.Forms.UserControl in a COM
environment, i.e. I want to host that control in a COM host. So far, so
good, I can host it, but I can not reach the parent COM object from the
control (Parent property is null :( ).
I have stopped the control in the...
|
by: cdj |
last post by:
Hi all,
I've got a picturebox on a form, and a save button. When I go to save,
the app craps out with the following error:
==================
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
|
by: Martin Montgomery |
last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc
Thank
Martin
|
by: melanieab |
last post by:
Hi,
I'm trying to save a bitmap file so I can print it later. I have
Image.Save("sImage.bmp",System.Drawing.Imaging.ImageFormat.Bmp);
The file sImage.bmp shows up in the bin\debug folder but when I try to print
it (or open it), it's completely black. I know Image is the correct picture
because when I immediately print it, it works. What am I doing wrong?
Thanks!
Melanie
| |
by: Özden Irmak |
last post by:
Hello,
I'm trying to save some properties of some windows controls into a XML File.
Most of the properties work when I save them as String
(TypeConverter.ConvertToString). But some complex properties like image,
collections such as tabpage's cannot done with this method.
Anybody can help me on how to save and later restore the complex properties?
|
by: Lance |
last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value
In order to indicate if a property should be serialized you can include a boolean function named...
|
by: AxOn |
last post by:
Hi! I'm having trouble creating a save funktion. How can I save the
contens of a new richTextBox that is created from an "external" class
file? The open funktion looks like this:
public void openFile()
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Title = "Select a Text File";
|
by: Jeff |
last post by:
Hey
(and thank you for reading my post)
In visual web developer 2005 express edition I've created a simple website
project..
At this website I want users who register to be able to upload a picture of
themselves to their profile... I admit that I'm a newbie... but this is how
I understand this:
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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...
| |
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| | |