Urgent HELP with usercontrols!!!!!!
-
Hello guys I've been trying to validate a textbox with user control and it seems like my text property i coded is wrong because if i show the content of the textbox like msgbox(textnox1.text) the msgbox is empty. this would be my design code:
_ Partial Class prodidtextbox Inherits System.Windows.Forms.UserControl 'UserControl overrides dispose to clean up the component list. _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. _ Private Sub InitializeComponent() Me.textbox1 = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'textbox1 ' Me.textbox1.Location = New System.Drawing.Point(0, 0) Me.textbox1.Name = "textbox1" Me.textbox1.Size = New System.Drawing.Size(100, 20) Me.textbox1.TabIndex = 0 ' 'prodidtextbox ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.Controls.Add(Me.textbox1) Me.Name = "prodidtextbox" Me.Size = New System.Drawing.Size(100, 20) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents textbox1 As System.Windows.Forms.TextBox End Class
and this is my textbox property codes:public class proidtexbox dim t as object public overrides property text() as string get return t end get set(byval value as string) t=value end set end property end class
please i need this to finish a class project that i should submit tomorrow thanks for you all reading thiseager to learn
-
Hello guys I've been trying to validate a textbox with user control and it seems like my text property i coded is wrong because if i show the content of the textbox like msgbox(textnox1.text) the msgbox is empty. this would be my design code:
_ Partial Class prodidtextbox Inherits System.Windows.Forms.UserControl 'UserControl overrides dispose to clean up the component list. _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. _ Private Sub InitializeComponent() Me.textbox1 = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'textbox1 ' Me.textbox1.Location = New System.Drawing.Point(0, 0) Me.textbox1.Name = "textbox1" Me.textbox1.Size = New System.Drawing.Size(100, 20) Me.textbox1.TabIndex = 0 ' 'prodidtextbox ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.Controls.Add(Me.textbox1) Me.Name = "prodidtextbox" Me.Size = New System.Drawing.Size(100, 20) Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents textbox1 As System.Windows.Forms.TextBox End Class
and this is my textbox property codes:public class proidtexbox dim t as object public overrides property text() as string get return t end get set(byval value as string) t=value end set end property end class
please i need this to finish a class project that i should submit tomorrow thanks for you all reading thiseager to learn
highjo wrote:
dim t as object public overrides property text() as string get return t end get set(byval value as string) t=value end set end property
If I understand your question correctly, you want to return the string that is typed in text1, right? if yes, you can try like that..
public overrides property Text() as string get return textbox1.Text end get set(byval value as string) textbox1.Text =value end set end property
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
highjo wrote:
dim t as object public overrides property text() as string get return t end get set(byval value as string) t=value end set end property
If I understand your question correctly, you want to return the string that is typed in text1, right? if yes, you can try like that..
public overrides property Text() as string get return textbox1.Text end get set(byval value as string) textbox1.Text =value end set end property
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)