Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Urgent HELP with usercontrols!!!!!!

Urgent HELP with usercontrols!!!!!!

Scheduled Pinned Locked Moved Visual Basic
graphicsdesignhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    highjo
    wrote on last edited by
    #1

    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 this

    eager to learn

    M 1 Reply Last reply
    0
    • H highjo

      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 this

      eager to learn

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      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)

      H 1 Reply Last reply
      0
      • M Michael Sync

        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)

        H Offline
        H Offline
        highjo
        wrote on last edited by
        #3

        Yeah! i think this should work thank you man.Didn't it is that obviuos thank you

        eager to learn

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups