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 / May 2005

Tip: Looking for answers? Try searching our database.

Designer visible property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mital - 06 May 2005 02:30 GMT
Hi,

I am creating my own designer using
http://www.divil.co.uk/net/articles/designers/hosting.asp (Also reading
through open source #Develop project.)

I can change Visible property of the control using propertygrid without any
problem, but if I change Visible property value to false using code, control
is hidden on the screen, and square control selection is apprer only.

How do I change property visible = false into propertgrid, but control is
still visible on the screen like visual studio does.

Kind Regards.

Mital
news.microsoft.com - 07 May 2005 03:18 GMT
How are you setting the Visible property in your code ? Have you tried
raising ComponentChanging/ComponentChanged (IComponentChangeService) ?

Using TypeDescriptor to set the property is equivalent.

Are you overriding the Visible property ? Are you calling base.Visible ?

Signature

Francisco Padron
www.chartfx.com

> Hi,
>
[quoted text clipped - 13 lines]
>
> Mital
Mital - 09 May 2005 00:42 GMT
Hi,

Thanks for reply. I have added context menu to the designer as "Implements
IMenuCommandService.ShowContextMenu". It means when user right click on the
control, it will show specific context menu based on control selection.

Based on click event of context menu I have done as follow inside class
MenuCommandService Implements IMenuCommandService:

Private sub mnuVisible_Click()
  Dim selectionService As ISelectionService =
CType(Me._host.GetService(GetType(ISelectionService)), ISelectionService)
  Dim selectedComponent As System.ComponentModel.Component =
CType(selectionService.PrimarySelection, System.ComponentModel.Component)
  selectedControl.Visible = False  '''<= This makes control invisible.
End Sub

I did not raised ComponentChanged event. Also, can you please provide code
snippet, how to set visible property using TypeDescriptor inside
MenuCommandService class?

Thanks again for your help.

Kind Regards.
Mital

> How are you setting the Visible property in your code ? Have you tried
> raising ComponentChanging/ComponentChanged (IComponentChangeService) ?
[quoted text clipped - 20 lines]
>>
>> Mital
Mital - 09 May 2005 01:17 GMT
Hi,

I have implemented TypeDescriptor as follow, which updates Visible property:

Dim oPropertyDescriptorCollection As
System.ComponentModel.PropertyDescriptorCollection =
System.ComponentModel.TypeDescriptor.GetProperties(selectedControl, True)
If Not oPropertyDescriptorCollection.Item("Visible") Is Nothing Then
       oPropertyDescriptorCollection.Item("Visible").SetValue(selectedControl,
False)
End If

I hope this is right way to implement Visible property as you specified.

Thanks & regards.
Mital

> Hi,
>
[quoted text clipped - 47 lines]
>>>
>>> Mital
Francisco Padron - 11 May 2005 20:01 GMT
That is exactly what I meant.

Did it work ?

Signature

Francisco Padron
www.chartfx.com


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.