HighTechTalks DotNet Forums  

Force UI of control to refresh on certain control property changed

Dotnet Framework (WinForms DesignTime) microsoft.public.dotnet.framework.windowsforms.designtime


Discuss Force UI of control to refresh on certain control property changed in the Dotnet Framework (WinForms DesignTime) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mikus Sleiners
 
Posts: n/a

Default Force UI of control to refresh on certain control property changed - 11-16-2007 , 05:40 AM






How do i make my custom control repaint certain component on control when
another property is changed?
Consider this example.

When i add windows label on form it's text value is automatically set to
label1.
Then i open proerties tab and change Text property and when i hit enter this
new value imediately get's reflected on label
.... i mean i set text to "label2" hit enter and imediately results are there
.... on the control so something causes control to be repainted...

Now ... another example let's say i add some property to default label
called TextEnding which should add some kind of additional text to
label.Text property.
No idea why this would be useful in any scenario, but let's just consider i
want this to be done.

So i would write something like this

[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Visible)]
[Bindable(false)]
[DefaultValue("")]
[Category("Appearance")]
[RefreshProperties(RefreshProperties.All)]
public string TextEnding
{
get
{
return textEnding;
}
set
{
textEnding = value;
Text = Text + value;
}
}

So if i now, if i open properties tab and set " the end" to TextEnding
property i would imediatelly see the changes on Text property
and it would look like this "label1 the end", BUT these changes would not
appear on label ... label control would still have its default value label1
only after build the new value get's reflected visually. The question is
what attributes should i apply to get the value changed imediatelly ?



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.