473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Still having problems with custom controls

hi

my custom control doesn't seem to store data, i.e. when i change the
value in the designer, when i run it the value has gone back to the
default value.. here's is a code snippet

this class stores the information, it is referenced in 3 places in my
custom control

public class Sizes
{
private int width, height;

public int Width {get{return width;}set{width=value;}}
public int Height {get{return height;}set{height=value;}}

public Sizes(int width, int height)
{
this.width = width;
this.height = height;
}
}
and in my control this is the property and variable

private Sizes cellSize;
public Sizes CellSize {get{return cellSize;}set{cellSize = value;}}

and the constructor (which is where i think the problem lies) says

cellSize = new Sizes(30,30);
When i goto the designer and change the value of CellSize, the value is
there but after i compile and run it, the value is back to 30,30 and not
what i set in the designer....

what am i missing??? i only stored c# a lil while back i used to use
borland c++ builder - so you see where my problems lie...

thanks
graeme
Nov 17 '05 #1
2 950
graeme g wrote:
and in my control this is the property and variable

private Sizes cellSize;
public Sizes CellSize {get{return cellSize;}set{cellSize = value;}}


Right in front of this last line, try putting

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]

Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Nov 17 '05 #2
Oliver Sturm wrote:
graeme g wrote:
and in my control this is the property and variable

private Sizes cellSize;
public Sizes CellSize {get{return cellSize;}set{cellSize = value;}}

Right in front of this last line, try putting

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]

Oliver Sturm

yay!!! thank yoo
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Bright | last post by:
I have set up custom Intellisense for our project. (In a nutshell, we will have ASP.NET controls based on many of the statndard WebControls, but with a few extensions that we will be adding). I've...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
2
by: Oliver | last post by:
hi all - - I'm probably a) completely wrong b) the umpteenth person too mention it - but I'm struggling to identify how to best work with re-usable units of UI on an ASP page. the problem is...
3
by: One Handed Man | last post by:
How can one fire an event programatically for a given control. In another post someone wanted to cause an event in order to make a RichTextBox scroll down. However, the onVscroll method is a...
6
by: Suzanne | last post by:
Hi all, I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom...
1
by: SlimFlem | last post by:
I hope this makes sense. Here is what I am attempting. I have an inital generic aspx page that has one custom tag: <web:site id=webSite runat=server/> When this control evaluates, it will...
0
by: guilligan.geo | last post by:
Hello, I'm trying to create an addin for Outlook 2002 using the one provided in the demo of win32com as a starting point. I've been able to do my addin and test it if I go the "standard" way...
14
by: joey.powell | last post by:
I am using VS2005 for a windows forms application. I need to be able to use a worker thread function to offload some processing from the UI thread. The worker thread will need access to a...
3
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am used to using third party controls when it comes to setting up appearences. But, now I am using Visual Basic.Net controls that come standard with the product. I've come across a frustration...
0
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
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
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...
0
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
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.