Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / December 2005

Tip: Looking for answers? Try searching our database.

Properties get serialized only then the control gets resized

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Montezuma - 28 Nov 2005 09:35 GMT
Hi,
this looks like a strange behavior.

I have two properties in my custom control whose relative code gets produced
only when i resize manually (and only manually, i mean with the mouse on the
design surface) the control size.

They won't change their value unless i resize manually the control.

Has somebody experienced this ever?

Montezuma
Gabriel Lozano-Morán - 28 Nov 2005 11:25 GMT
> I have two properties in my custom control whose relative code gets produced
> only when i resize manually (and only manually, i mean with the mouse on the
> design surface) the control size.

As opposite to resizing how? And if you set the size property of the control
in the property grid? What happens?

Gabriel Lozano-Morán
Carlo - 28 Nov 2005 11:48 GMT
I experienced the same problem.
After a week of tests and searching, It was solved after installing
Framework 1.1 SP1.
So, install Framework 1.1 Service Pack 1.

HTH

Carlo

-------------------------------------------
Carlo, MCP (Windows Based Applications)
carlodevREMOVE@gmail.com

> Hi,
> this looks like a strange behavior.
[quoted text clipped - 8 lines]
>
> Montezuma
Montezuma - 28 Nov 2005 15:00 GMT
Thanks a lot.

>I experienced the same problem.
> After a week of tests and searching, It was solved after installing
[quoted text clipped - 21 lines]
>>
>> Montezuma
Cristian Balcanu - 29 Nov 2005 00:11 GMT
I think that those properties should be changed programatically using
TypeDescriptor and PropertyDescriptor (because you posted the question on
this news-group I guess is something about design time).

> Hi,
> this looks like a strange behavior.
[quoted text clipped - 8 lines]
>
> Montezuma
jokiz - 02 Dec 2005 09:17 GMT
the designer was not notified of the changes made, probably your
properties are dependent on others and you changed it through code
without notifying the designer, christian is correct.  since the
designer was notifies of the size change (on resize), he tries to
serialize the changes.  designer does not serialize code when it does
not sense a change.
Montezuma - 26 Dec 2005 13:37 GMT
Hi guys,
thanks for your answers, they led me quickly to the solution (ok, i have
not been working for a while on it).

One needs simply to invoke the "OnComponentChanging" and the
"OnComponentChanged" method provided by the IComponentChangeService.

So:

***
IComponentChangeService c =
(IComponentChangeService)GetService(typeof(IComponentChangeService));
                   
c.OnComponentChanging(yourComponent, null);
yourComponent.someProperty = false;               
c.OnComponentChanged(yourComponent, null, null, null);
***

This will notify the designer of the change made on yourComponent.

Have fun.
Montezuma

jokiz ha scritto:
> the designer was not notified of the changes made, probably your
> properties are dependent on others and you changed it through code
> without notifying the designer, christian is correct.  since the
> designer was notifies of the size change (on resize), he tries to
> serialize the changes.  designer does not serialize code when it does
> not sense a change.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.