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

How do I have a UITypeEditor tell the Designer that the component has changed?

Hi,

When I change properties through the property window on my custom control
and then move focus from that property cell VS.Net runs the
GetDesignTimeHtml() method on my designer. When I implement a UITypeEditor,
change the values, then close the editor nothing happens until I switch the
HTML view (which shows the changes) and then switch back to design view
which then shows the new stuff.

I can get to my component through the Context.Instance object in the
EditValue method but I can't figure out how to get a reference to the
designer to call GetDesignTimeHtml(). When the editor closes and I assign
the value to the property of my control I can set a breakpoint where the
property is assigned the new value but I still can't see how to get a
reference to the designer. How can I call GetDesignTimeHtml() or get it to
be called after my control changes due to action taken in a custom
UITypeEditor?
***Follow Up:

With the following code in the Set method of my property that gets updated
from the custom UITypeEditor I can all the UpdateDesignTimeHtml() function:

Dim x As New MenuDesigner
x.Initialize(Me)
x.IsDirty = True
x.UpdateDesignTimeHtml()

I overrode the UpdateDesignTimeHtml() function so I could set a breakpoint
and in it I just call the base classes method. When I call this myself, it
gets hit and runs and still nothing changes in the design screen. However,
I added a bogus property that has no editor. When I change it in the
property window and move focus from it, it calls UpdateDesignTimeHtml() and
the updated control instantly renders. I scoured the Designer object when I
hit the break point in the UpdateDesignTimeHtml() function and everything
seems to be set the same regardless of if I call it or VS.Net does. IsDirty
is set to True, it shows the correct ID of the control it is designing for,
all references appear to be identical. What am I missing here?

***2nd Follow Up:

It appears that when I call UpdateDesignTimeHtml() directly,
GetDesignTimeHtml() is never called. But when VS.Net calls it after
editing a property in the property window, it is
called. What do I need to do to my component to put it in a state where
it'll fire the GetDesign... method when I call the UpdateDesign... method?
I've tried creating a function like this:

Public Sub MarkChange()
Dim c As IComponentChangeService =
DirectCast(GetService(GetType(IComponentChangeServ ice)),
IComponentChangeService)
c.OnComponentChanging(Me, Nothing)
c.OnComponentChanged(Me, Nothing, Nothing, Nothing)
End Sub

Which I call before I call the UpdateDesign... method. However it still
doesn't help. Thanks for any input. Ken.

Nov 19 '05 #1
0 1391

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
0
by: public heath vb developer | last post by:
We have several programs that will lose datasets from the designer and / or give compile time errors if a component is changed on the form. This is one of the lines of code that is flagged as an...
1
by: Raffe | last post by:
Hi all! I've been playing a bit with Component Designer in Visual Studio.NET. Seems to me like a great way to build simple data access components using "point and click". However I can't figure...
0
by: Sujith Manuel | last post by:
Hi All, I am developing a Dotnet component in C#, and it has got a set of design time properties which can be changed using the Properties Window. The problem I am facing here is, whenever you...
2
by: Jacob | last post by:
I'm writing a custom component with an accompanying designer. I have the designer set up to notify me of changes to some of the components properties so that I can changed the designer verbs....
0
by: Mike | last post by:
Hi All, I am using a COM object and so I have to use a form for it to work. The problem is I need to run it as a service as well. When I run it in a test scenario everything works fine and...
2
by: Ahmed Hashish | last post by:
In building controls we need to create Custom UITypeEditor classes, most of this classes (in my case) doing the same job, its used to support the controls properties with a drop down list contains...
13
by: alex sparsky | last post by:
I have a custom collection in my c# winform ui control called Items. Items is a built in collection type that does not allow itself to be replace (you can't 'set' the itemscollection in the...
3
by: Tin Gherdanarra | last post by:
A colleague gave me a project where there was a /designer/ window for database connectivity (drag&drop from the toolbox), but I can't find out how to get a /designer/ window in my own project....
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: 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
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
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
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,...
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
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.