Target Controls inside a UserControl

Posts 1–11 of 11 · Page 1 of 1
Target Controls inside a UserControl
Simple question..
How would you edit properties of a control inside a User Control?

Example:
Code:
userControl1.TextBox1.Text = "Blaaaah"
I've tried using something like this
Code:
Public Property TargetProcessBox() As String        Get
            Return Me.txtTarget.Text
        End Get
        Set(ByVal value As String)
            Me.txtTarget.Text = value
        End Set
    End Property
but apparently it isn't working =/
I don't see why the property doesn't work. Maybe the control isn't redrawing itself? Try calling Refresh on the txtTarget after you set the Text property.
@master131 @-HAYEM
Using another form, no controls show up showing that the code would be used.. like

"UserControl1." and no controls shows up

I just wanna change the property of a textbox from another user control form. VB is failing me
Quote Originally Posted by DawgiiStylz View Post
@master131 @-HAYEM
Using another form, no controls show up showing that the code would be used.. like

"UserControl1." and no controls shows up

I just wanna change the property of a textbox from another user control form. VB is failing me
Have you even added the UserControl to your form? Doesn't sound like you have. Just adding it to the project doesn't mean that it can magically be accessed by other forms.
TRY TO CHANGE THE NAMES
Quote Originally Posted by DawgiiStylz View Post
@master131 @-HAYEM
Using another form, no controls show up showing that the code would be used.. like

"UserControl1." and no controls shows up

I just wanna change the property of a textbox from another user control form. VB is failing me
I think I got it
Just use
[Form Name].[Control Name].[Property] = [Value]
@Aly El-Haddad He did use [Form]. Me = [Current Form]

I think Jason is right. If no* properties are coming up after the dot..sounds like you haven't actually added the control to your form yet.
Did you drag the control from the toolbox onto your form?
or create it in code w/ Dim myCustomControl As UserControl1 = New UserControl1() and be sure to give it an x,y location.
Quote Originally Posted by abuckau907 View Post
I think Jason is right. If no* properties are coming up after the dot..sounds like you haven't actually added the control to your form yet.
Did you drag the control from the toolbox onto your form?
or create it in code w/ Dim myCustomControl As UserControl1 = New UserControl1() and be sure to give it an x,y location.
/fp I forgot about doing that. Thanks and Jason you too
Quote Originally Posted by DawgiiStylz View Post


/fp I forgot about doing that. Thanks and Jason you too
LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL :O
Quote Originally Posted by Jason View Post


LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL :O
Don't laugh at me lol
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us