473,414 Members | 1,980 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,414 software developers and data experts.

PropertyValueChanged event

I have a custom object that I use in a PropertyGrid as seen below. It
presents an elipsis button that when clicked brings up a custom modal
dialog. When I make a change in the property, the PropertyValueChanged event
never gets fired. I have other properties in the PropertyGrid that do fire
the event. Is there anything special that I need to do to have the event
fired?

[System::ComponentModel::EditorAttribute(__typeof(C PictureEditor),
__typeof(System::Drawing::Design::UITypeEditor))]
[System::ComponentModel::TypeConverterAttribute(__t ypeof(CPictureConverter))
]
[Serializable]
public __gc class PictureObj : public
System::Runtime::Serialization::ISerializable
{
private:
CPicture* m_pPicture;
public:
PictureObj()
{
m_pPicture = new CPicture;
}
~PictureObj()
{
delete m_pPicture;
}
PictureObj(System::Runtime::Serialization::Seriali zationInfo *si,
System::Runtime::Serialization::StreamingContext sc)
{
m_pPicture = new CPicture;
SetObjectData(si, sc);
}
void SetPicture(CPicture* pic) { *m_pPicture = *pic; }
CPicture* GetPicture() { return m_pPicture; }
void GetObjectData(System::Runtime::Serialization::Seri alizationInfo
*si,

System::Runtime::Serialization::StreamingContext sc);
void SetObjectData(System::Runtime::Serialization::Seri alizationInfo
*si,

System::Runtime::Serialization::StreamingContext sc);

__property IPicture* get_Picture() { return m_pPicture->m_pImage; }
__property void set_Picture(IPicture* value) { m_pPicture->m_pImage =
value; }
__property System::String* get_ImageExt() { return new
System::String(m_pPicture->m_strImageExt); }
__property void set_ImageExt(System::String* value) {
m_pPicture->m_strImageExt = value; }
};

Nov 17 '05 #1
2 2472
Hi David,

Is this the complete code? I don't see the event handler nor the event
hookup. If you have those, please post them as well.
If you don't have them, you need to get the event hooked up.

Thanks,
Earl Beaman
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no
rights.
Nov 17 '05 #2
Hi,

You need to create your own class that derived from UITypeEditor and
override the EditValue method. In that method open the form and when you
finish return the value to the Value parameter. You should also override
the GetEditStyle to set the modal mode.

This, at least, works for me.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3

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

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
0
by: Danny | last post by:
I put a PropertyGrid in my windows application. I want to change a object's property in Runtime I used PropertyValueChanged event to tell the application which property has been changed But if the...
0
by: rawCoder | last post by:
Hi All, I have a class set as source object for a propertygrid. This class is being persisted in custom way in XML file. When the data changes, which i get to know form the PropertyValueChanged...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
0
by: stulika19 | last post by:
Hi I am using Collection Editor in my Property Grid.When I change value of a property in the property grid, the PropertyValueChanged event is raised and and I am able to execute certain lines of...
0
by: Tulika Shrivastava | last post by:
Hi I am using Collection Editor in my Property Grid.When I change value of a property in the property grid, the PropertyValueChanged event is raised and and I am able to execute certain lines of...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.