Click here to Skip to main content
15,892,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: instance of usercontrol not exposing all properties Pin
treddie10-May-13 16:36
treddie10-May-13 16:36 
AnswerRe: instance of usercontrol not exposing all properties Pin
TnTinMn9-May-13 14:47
TnTinMn9-May-13 14:47 
GeneralRe: instance of usercontrol not exposing all properties Pin
treddie9-May-13 20:19
treddie9-May-13 20:19 
GeneralRe: instance of usercontrol not exposing all properties Pin
Dave Kreskowiak10-May-13 1:08
mveDave Kreskowiak10-May-13 1:08 
GeneralRe: instance of usercontrol not exposing all properties Pin
treddie10-May-13 16:20
treddie10-May-13 16:20 
GeneralRe: instance of usercontrol not exposing all properties Pin
TnTinMn10-May-13 3:40
TnTinMn10-May-13 3:40 
GeneralRe: instance of usercontrol not exposing all properties Pin
treddie10-May-13 16:34
treddie10-May-13 16:34 
AnswerRe: instance of usercontrol not exposing all properties Pin
TnTinMn10-May-13 18:50
TnTinMn10-May-13 18:50 
Quote:
So basically, declaring properties is the only way to get those properties to the user.

Not exactly. And I don't know why I did think of this earlier. Sigh | :sigh: Confused | :confused:

Assume you place the UserControl in a class library.

As previously mentioned, you could change the child control's access modifier to Public and it would show up in the property grid and you could try to set it's properties. They would appear as set in the designer, however any of the changes are only held in Visual Studio's memory and not written to disk as part of the designer generated code. Building the project would clear any of these apparent property changes. To avoid confusion in the designer, I would set the access modifier to private and expose it through a property like this:
XML
<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)> _
<System.ComponentModel.Browsable(True)> _
Public ReadOnly Property ExposedTreeView As TreeView
    Get
        Return TreeView1
    End Get
End Property


This allows you to reference the child control in both code and via the property grid for the placed UserControl. The magic is in the DesignerSerializationVisibilityAttribute. It tells the designer to write the changes to the Form.designer.vb file.
GeneralRe: instance of usercontrol not exposing all properties Pin
treddie10-May-13 21:13
treddie10-May-13 21:13 
QuestionHow to add rows to datagridview from comboboxes in windows forms application Pin
Agontuk9-May-13 9:04
Agontuk9-May-13 9:04 
AnswerRe: How to add rows to datagridview from comboboxes in windows forms application Pin
TnTinMn9-May-13 15:09
TnTinMn9-May-13 15:09 
QuestionSockets Using play youtube videos Pin
johnmackency8-May-13 20:57
johnmackency8-May-13 20:57 
AnswerRe: Sockets Using play youtube videos Pin
Richard MacCutchan9-May-13 1:19
mveRichard MacCutchan9-May-13 1:19 
AnswerRe: Sockets Using play youtube videos Pin
Dave Kreskowiak9-May-13 1:39
mveDave Kreskowiak9-May-13 1:39 
QuestionBitwise AND in an If/Else block Pin
treddie7-May-13 11:33
treddie7-May-13 11:33 
AnswerRe: Bitwise AND in an If/Else block Pin
Dave Kreskowiak7-May-13 14:49
mveDave Kreskowiak7-May-13 14:49 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie7-May-13 17:04
treddie7-May-13 17:04 
GeneralRe: Bitwise AND in an If/Else block Pin
Richard MacCutchan7-May-13 21:19
mveRichard MacCutchan7-May-13 21:19 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie7-May-13 22:38
treddie7-May-13 22:38 
GeneralRe: Bitwise AND in an If/Else block Pin
Bernhard Hiller7-May-13 23:07
Bernhard Hiller7-May-13 23:07 
GeneralRe: Bitwise AND in an If/Else block Pin
Dave Kreskowiak8-May-13 1:58
mveDave Kreskowiak8-May-13 1:58 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie8-May-13 11:23
treddie8-May-13 11:23 
GeneralRe: Bitwise AND in an If/Else block Pin
Dave Kreskowiak8-May-13 13:18
mveDave Kreskowiak8-May-13 13:18 
GeneralRe: Bitwise AND in an If/Else block Pin
Richard MacCutchan8-May-13 20:56
mveRichard MacCutchan8-May-13 20:56 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie8-May-13 22:14
treddie8-May-13 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.