Results 1 to 3 of 3

Thread: center the control(resolved)

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    center the control(resolved)

    Hey ,
    simple question : How can I center webbrowser or any control on a form ?
    thanx for any help
    Last edited by Pirate; Dec 21st, 2002 at 02:01 PM.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    meh, you could use a stupid function like this:
    VB Code:
    1. Private Sub centerControl(ByVal ctrl As Control)
    2.         ctrl.Left = (Me.ClientSize.Width - ctrl.Width) / 2
    3.         ctrl.Top = (Me.ClientSize.Height - ctrl.Height) / 2
    4.     End Sub

    but I hope there is a better way
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    thanx , it worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width