Button Creation in VB

Author Message
mladost1

  • Total Posts : 4
  • Scores: 0
  • Reward points : 0
  • Joined: 6/23/2008
  • Status: offline
Button Creation in VB Friday, June 27, 2008 10:37 PM (permalink)
0
       Dim Button As New Windows.Forms.Button()
        Button.Location.X.Equals(100)
        Button.Location.Y.Equals(100)
        Button.Enabled = True
        Button.Visible = True
        Button.Text = "ASD"
        Button.BackColor = Color.Coral
        Button.CreateControl()
        MessageBox.Show(Convert.ToString(Button), "topic", 0)

This does not show a button...don't know why. It is in a onLoad fucntion so i am sure it is called. Help please
 
#1
    dm_4ever

    • Total Posts : 3687
    • Scores: 82
    • Reward points : 0
    • Joined: 6/29/2006
    • Location: Orange County, California
    • Status: offline
    RE: Button Creation in VB Saturday, June 28, 2008 4:28 AM (permalink)
    0
    This looks more like VB than VBScript which is why I moved your post.

    I haven't played with VB, but I think that if you want your button to appear on your form, you would need to add it as a control to that form....just a thought

           Dim Button As New Windows.Forms.Button()
           Button.Location.X.Equals(100)
           Button.Location.Y.Equals(100)
           Button.Enabled = True
           Button.Visible = True
           Button.Text = "ASD"
           Button.BackColor = Color.Coral
          
           Me.Controls.Add(Button)
    dm_4ever

    My philosophy: K.I.S.S - Keep It Simple Stupid
    Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
    Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9