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. VB6 Button.Value = true/false - how to do this in VB.NET

VB6 Button.Value = true/false - how to do this in VB.NET

Scheduled Pinned Locked Moved Visual Basic
helpcsharptutorialquestion
3 Posts 3 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.
  • A Offline
    A Offline
    AR Reddy
    wrote on last edited by
    #1

    Hi, I dont see any value property for button. When I convert VB6 application to VB.net, the code as follows VB 6.0 Public Property Get VarArray(ByVal ctrl As Control) As String VarArray = ctrl.Value End Property After converting to VB.NET Public ReadOnly Property VarArray(ByVal ctrl As System.Windows.Forms.Control) As String Get 'UPGRADE_WARNING: Couldn't resolve default property of object ctrl.Value. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' VarArray = ctrl.Value End Get End Property Here VB.NET code is giving compilation error "Value is not member of 'System.Windows.Forms.Control'" Please let me know how to do this. Thanks in Advance,

    AR Reddy

    P L 2 Replies Last reply
    0
    • A AR Reddy

      Hi, I dont see any value property for button. When I convert VB6 application to VB.net, the code as follows VB 6.0 Public Property Get VarArray(ByVal ctrl As Control) As String VarArray = ctrl.Value End Property After converting to VB.NET Public ReadOnly Property VarArray(ByVal ctrl As System.Windows.Forms.Control) As String Get 'UPGRADE_WARNING: Couldn't resolve default property of object ctrl.Value. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' VarArray = ctrl.Value End Get End Property Here VB.NET code is giving compilation error "Value is not member of 'System.Windows.Forms.Control'" Please let me know how to do this. Thanks in Advance,

      AR Reddy

      P Offline
      P Offline
      paas
      wrote on last edited by
      #2

      You could consider going through the trouble of inheriting System.Windows.Forms.Button to create your own button control that has a Value property, but that process, although not particularly difficult, may still not be necessary. Maybe you can simply manipulate the button's Tag property in .Net to emulate how you were using the Value property?

      1 Reply Last reply
      0
      • A AR Reddy

        Hi, I dont see any value property for button. When I convert VB6 application to VB.net, the code as follows VB 6.0 Public Property Get VarArray(ByVal ctrl As Control) As String VarArray = ctrl.Value End Property After converting to VB.NET Public ReadOnly Property VarArray(ByVal ctrl As System.Windows.Forms.Control) As String Get 'UPGRADE_WARNING: Couldn't resolve default property of object ctrl.Value. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' VarArray = ctrl.Value End Get End Property Here VB.NET code is giving compilation error "Value is not member of 'System.Windows.Forms.Control'" Please let me know how to do this. Thanks in Advance,

        AR Reddy

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        A couple things: First, the property Value on a CommandButton in VB6 is a Boolean - not a string. Secondly, In all of VB6's infinite wisdom, doing Call Command1_Click() has the same effect of setting Command1.Value=True in code. So, the only time VarArray in your VB6 code above would be true is when Command1_Click() is called. :sigh: If you are using RadioButtons or CheckBoxes, Value was replaced by Checked.

        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