6 replies
by kgreenwood
by tuanna123
by shanghai sam
I assume you already have properties within your class...I'll use an example property called caption (string)
First add the property page (Project|Add Property Page), give it a meaningful name.
Place a textbox (and any other controls you need for each of your properties) onto the page, in this example I will call the textbox txtCaption.
Doublelclick on the page to open the code window where you will see Private Sub PropertyPage_SelectionChanged()
place this code in there
'get the caption of the first control
txtCaption.Text = SelectedControls(0).Caption
The purpose of this event is to get the existing property values from the control or controls that are currently selected, more than one of your control could be selected. You'll have to decide how to handle mutiple selections for each of your properties...use something like this for properties that need to be singular
if selectedcontrols.count > 1 then
txtCaption.enabled=false
else
txtCaption.enabled=true
end if
to set the properties for all selected controls
add this code in the ApplyChanges procedure
dim obj
for each obj in SelectedControls
obj.Caption=txtCaption.txt
next
and then to enable the Apply button
place code in
Private Sub txtCaption_Change()
changed=true
End Sub
now you can this property page as indicated in my previous post
by tuanna123
by sl-campbell
I'm sure that you will find a fast answer in the tek-tips forum:
www.tek-tips.com
Check the "Visual Basic(Microsoft) -Version 5 & 6" Forum at tek-tips.
by tuanna123
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending