473,385 Members | 2,015 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,385 software developers and data experts.

making an ambient property

Hi, i want to make an ambient property for my control.

i have the ambient part working just fine , but in order to make this work
correctly in designtime i need to be able to set the "DefaultValue" of the
property dynamicly (not via [defaultvalue] attrib)
i mean , when placing a control on a form , the control get the same color
as the parent control , and the color is "defaulted"/"unchanged" it shows up
in the propbrowser as unchanged (not bold) and it does not persist to the
initialize code

what should i do to accomplis the same?

should i make a typeconverter? typeeditor? controldesigner?

what?

//Roger
Jul 21 '05 #1
1 2061
ShouldSerialize and Reset methods should be used in this case, instead of
the DefaultValue() attribute.

i.e.
\\\
Public Property MyBackColor() As Color
..
End Property

Private Function ShouldSerializeMyBackColor() As Boolean
Return Not MyBackColor.Equals(Parent.BackColor)
End Function

Private Sub ResetMyBackColor()
MyBackColor = Parent.BackColor
End Sub
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Roger" <Ro***@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
Hi, i want to make an ambient property for my control.

i have the ambient part working just fine , but in order to make this work
correctly in designtime i need to be able to set the "DefaultValue" of the
property dynamicly (not via [defaultvalue] attrib)
i mean , when placing a control on a form , the control get the same color
as the parent control , and the color is "defaulted"/"unchanged" it shows
up
in the propbrowser as unchanged (not bold) and it does not persist to the
initialize code

what should i do to accomplis the same?

should i make a typeconverter? typeeditor? controldesigner?

what?

//Roger

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Jul 21 '05 #2

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

Similar topics

7
by: Christopher Jeris | last post by:
I am relatively new to JavaScript, though not to programming, and I'm having trouble finding the idiomatic JS solution to the following problem. I have a table with (say) fields f1, f2, f3. I...
4
by: Derrick | last post by:
Hello all; I'm trying to simulate a "scrollable context menu". What I want is to have a listbox fill the entire area of a small form (with no border). Using the designer and property grid, I...
10
by: Jeff Grills | last post by:
I am an experienced C++ programmer with over 12 years of development, and I think I know C++ quite well. I'm changing jobs at the moment, and I have about a month between leaving my last job and...
9
by: tshad | last post by:
I have a datagrid that I want to add a new column to. This column will only be visible under certain conditions. So I want to set the column visible=false. Then when the right condition happens...
1
by: Roger | last post by:
Hi, i want to make an ambient property for my control. i have the ambient part working just fine , but in order to make this work correctly in designtime i need to be able to set the...
15
by: Sam Kong | last post by:
Hello! I got recently intrigued with JavaScript's prototype-based object-orientation. However, I still don't understand the mechanism clearly. What's the difference between the following...
8
by: Hansen | last post by:
Hi I have a form with multiple labels and textboxes and listboxes that need to be made visible and not visible when buttons are clicked. Is there anyway of grouping them together so that I have...
0
by: G.S. | last post by:
Hi all, We've encountered an issue and would appreciate some help. A SHAPE command, executed via MSDataShape-provider connection doesn't seem to be able to participate implicitly in an ongoing...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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,...

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.