Help,pls,how to resize and move a button at run time

in vb6 I can use the API SendMessage(),but it doesn't work in vb.net
I don't know why?Can someone help me?

Comments

  • Dim oSize As Size
    Dim oLocation As Point

    'To resize
    oSize.Width = Button1.Width + 2 'Some width value
    oSize.Height = Button1.Height + 2 'Some height value
    Button1.Size = oSize

    'To move
    oLocation.X = Button1.Left + 2 'Some x co-ordinate
    oLocation.Y = Button1.Height + 2 'Some y co-ordinate
    Button1.Location = oLocation


  • : Dim oSize As Size
    : Dim oLocation As Point
    :
    : 'To resize
    : oSize.Width = Button1.Width + 2 'Some width value
    : oSize.Height = Button1.Height + 2 'Some height value
    : Button1.Size = oSize
    :
    : 'To move
    : oLocation.X = Button1.Left + 2 'Some x co-ordinate
    : oLocation.Y = Button1.Height + 2 'Some y co-ordinate
    : Button1.Location = oLocation
    :
    :
    :
    Thank u.but what I mean is that I can use my mouse to change the size and location at run time.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories