|
-
Oct 20th, 2005, 06:32 AM
#1
Thread Starter
New Member
[RESOLVED] How to show merged properties between objects ?
Hi all,
in VB.NET I have two classes with different properties, for example (pseudo code)
class_A
property text
property color
Class_B
property text
property width
I have a designer where objects can be selected and edited.
When I select an object of type Class_A, I can set the propertybox to show the property of Class_A, and when an object of Class_B is selected, then the property of Class_B are shown.
The problem is that when both objects are selected, I would like to show only the common properties; in the above example, the propertybox should only show the property "text".
How can I do this ?
Thanks for your attention,
Sergio.
-
Oct 20th, 2005, 07:32 AM
#2
Thread Starter
New Member
Re: How to show merged properties between objects ?
Never mind, I've solved it.
Example (not complete code)
VB Code:
Dim selectedprops(cnt) As Object 'Array of properties
Try
For i = 0 To selected_objects - 1
Dim theprop As Object
Select Case get_object_type(object_Selection(i))
Case MyType.textbox
theprop = New my_Textbox
Case MyType.label
theprop = New my_Label
Case MyType.checkbox
theprop = New my_Checkbox
End Select
If Not theprop Is Nothing Then
selectedprops.SetValue(CType(theprop, Object), i)
End If
Next
Me.PropertyGrid1.SelectedObjects = selectedprops
Last edited by oigres; Oct 20th, 2005 at 07:38 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|