473,399 Members | 3,888 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,399 software developers and data experts.

Control usage question

1. I have an image list defined in a control
2. I want to expose trough properties the image list in a manner to be able
to change it from the container where the control is used.

How do I do that?

--
Horatiu Ripa
Nov 15 '05 #1
4 1260
Use a property

public ImageList ControlImageList
{
get
{
return imageList;
}
}

ImageList is a class and so a reference type. This means, once you get the
reference to the image list object, you can modify it however you want.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
1. I have an image list defined in a control
2. I want to expose trough properties the image list in a manner to be able to change it from the container where the control is used.

How do I do that?

--
Horatiu Ripa

Nov 15 '05 #2
Let's be more clear:
I've made:

public System.Windows.Forms.ImageList Buttons_Image_list
{ get {return buttonsImageList;}
set {buttonsImageList = value;} }

results:
I've modify the property Buttons_Image_list property of my control (in designer, used in the container) to an image list defined there; nothing hapened or on the design or runtime.

If I put above the property definition:
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)] to change the default serialization from Visible to content, it initially displays the correct image list at design and runtime, but at the second build (run) , I receive an error:
"There is already a component named 'myImageList'. Components must have unique names, and names must be case-insensitive. A name also cannot conflict with the name of any component in an inherited class."

Any ideas????
--
Horatiu Ripa
Software Development Manager
Business Logic Systems LTD
21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
Phone/Fax: +40 264 590703
Web: www.businesslogic.co.uk

This email (email message and any attachments) is strictly confidential, possibly privileged and is intended solely for the person or organization to whom it is addressed. If you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this email in error, please inform the sender immediately before deleting it. Business Logic Systems Ltd accepts no responsibility for any advice, opinion, conclusion or other information contained in this email or arising from its disclosure.

"Vijaye Raji" <no************@hotmail.com> wrote in message news:O1**************@TK2MSFTNGP12.phx.gbl...
Use a property

public ImageList ControlImageList
{
get
{
return imageList;
}
}

ImageList is a class and so a reference type. This means, once you get the
reference to the image list object, you can modify it however you want.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
1. I have an image list defined in a control
2. I want to expose trough properties the image list in a manner to be

able
to change it from the container where the control is used.

How do I do that?

--
Horatiu Ripa


Nov 15 '05 #3
I guess I'd need some code snippets to figure out the problem. Also, where
did "myImageList" come from?

All properties are serialized by default to code and so, you wouldn't need
the "DesignerSerializationVisibility" attribute at all.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
Let's be more clear:
I've made:

public System.Windows.Forms.ImageList Buttons_Image_list
{ get {return buttonsImageList;}
set {buttonsImageList = value;} }

results:
I've modify the property Buttons_Image_list property of my control (in
designer, used in the container) to an image list defined there; nothing
hapened or on the design or runtime.

If I put above the property definition:
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
to change the default serialization from Visible to content, it initially
displays the correct image list at design and runtime, but at the second
build (run) , I receive an error:
"There is already a component named 'myImageList'. Components must have
unique names, and names must be case-insensitive. A name also cannot
conflict with the name of any component in an inherited class."

Any ideas????
--
Horatiu Ripa
Software Development Manager
Business Logic Systems LTD
21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
Phone/Fax: +40 264 590703
Web: www.businesslogic.co.uk

This email (email message and any attachments) is strictly confidential,
possibly privileged and is intended solely for the person or organization to
whom it is addressed. If you are not the intended recipient, you must not
copy, distribute or take any action in reliance on it. If you have received
this email in error, please inform the sender immediately before deleting
it. Business Logic Systems Ltd accepts no responsibility for any advice,
opinion, conclusion or other information contained in this email or arising
from its disclosure.

"Vijaye Raji" <no************@hotmail.com> wrote in message
news:O1**************@TK2MSFTNGP12.phx.gbl...
Use a property

public ImageList ControlImageList
{
get
{
return imageList;
}
}

ImageList is a class and so a reference type. This means, once you get the reference to the image list object, you can modify it however you want.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
1. I have an image list defined in a control
2. I want to expose trough properties the image list in a manner to be

able
to change it from the container where the control is used.

How do I do that?

--
Horatiu Ripa


Nov 15 '05 #4

myImageList is the ImageList defined in the form where I use the control.
My knowkedge is that "DesignerSerializationVisibility" default for a public
property is "view". Anyhow it does not work at all, with or whithout
DesignerSerializationVisibility attribute set to view. The only way it works
is, as I mentioned below, with
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
but only for the first time.

I'm suspecting the property designer - code generator to have some bug...

--
Horatiu Ripa
1
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:ef**************@TK2MSFTNGP11.phx.gbl...
I guess I'd need some code snippets to figure out the problem. Also, where did "myImageList" come from?

All properties are serialized by default to code and so, you wouldn't need
the "DesignerSerializationVisibility" attribute at all.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
Let's be more clear:
I've made:

public System.Windows.Forms.ImageList Buttons_Image_list
{ get {return buttonsImageList;}
set {buttonsImageList = value;} }

results:
I've modify the property Buttons_Image_list property of my control (in
designer, used in the container) to an image list defined there; nothing
hapened or on the design or runtime.

If I put above the property definition:
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
to change the default serialization from Visible to content, it initially
displays the correct image list at design and runtime, but at the second
build (run) , I receive an error:
"There is already a component named 'myImageList'. Components must have
unique names, and names must be case-insensitive. A name also cannot
conflict with the name of any component in an inherited class."

Any ideas????
--
Horatiu Ripa
Software Development Manager
Business Logic Systems LTD
21 Victor Babes str., 1st floor, 3400 Cluj-Napoca, Romania
Phone/Fax: +40 264 590703
Web: www.businesslogic.co.uk

This email (email message and any attachments) is strictly confidential,
possibly privileged and is intended solely for the person or organization to whom it is addressed. If you are not the intended recipient, you must not
copy, distribute or take any action in reliance on it. If you have received this email in error, please inform the sender immediately before deleting
it. Business Logic Systems Ltd accepts no responsibility for any advice,
opinion, conclusion or other information contained in this email or arising from its disclosure.

"Vijaye Raji" <no************@hotmail.com> wrote in message
news:O1**************@TK2MSFTNGP12.phx.gbl...
Use a property

public ImageList ControlImageList
{
get
{
return imageList;
}
}

ImageList is a class and so a reference type. This means, once you get

the
reference to the image list object, you can modify it however you want.

-vJ

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
1. I have an image list defined in a control
2. I want to expose trough properties the image list in a manner to be

able
to change it from the container where the control is used.

How do I do that?

--
Horatiu Ripa



Nov 15 '05 #5

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

Similar topics

10
by: Philo Del Middleston | last post by:
I've been searching, but apparently not phrasing my search right, so I'm going to float a question out here in the meantime... I'm wondering how to go about refreshing the content of a control...
4
by: Davy | last post by:
Hi all, I am writing programs of algorithms using C++ and C. When I run the programs, I found the programs take 100 percent of the CPU usage and I cannot run any other program. How to control...
13
by: shan | last post by:
Hi to everybody here is my simple doubt What is meant by sentinel control loops ?
6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
11
by: Hoku | last post by:
I am using dual monitors on a dual head ATI AGP4x video card. I installed the Nov 11 2005 release of ATI's catalyst control center with Hydravision to manage the dual monitor setup. I recently...
2
by: Marc Gravell | last post by:
::: Question: Does anyone know of a simple Control / UserControl implementation that hosts a UITypeEditor? Or the correct way to call PropertyDescriptor.GetEditor() and get a non-null result for...
2
by: TheSteph | last post by:
Hi ! I have a question : the ComboBox control have NO single border, and height is at least 1 pixel higher than TextBox. There is absolutely NO good reason for making a ComboBox looking that...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
0
by: Artem Ploujnikov | last post by:
Hello everyone... I'm wondering if it's possible to bind the parameters of, say, an ObjectDataSource to one of the properties of the user control that contains the data source in question......
17
by: Cesar | last post by:
Hello people. I'm having a Winform app that contains a webbrowser control that keeps navigating from one page to another permanentrly to make some tests. The problem I'm having is that after a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.