473,383 Members | 1,868 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,383 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 2060
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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...
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...

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.