Results 1 to 9 of 9

Thread: how can I set the form's clientsize?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    how can I set the form's clientsize?

    if you set the form's size using form.width or .height, it will not set it's clientsize to that size. I'm wondering how I can set the clientsize of a form, which is, the size of the form ignoring the title bar size and other stuff
    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!!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this :
    VB Code:
    1. Me.Location = New Point((Me.ClientSize.Width / 2) - (Me.Size.Width / 2), (Me.ClientSize.Height / 2) - (Me.Size.Height / 2))

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    location?! no no
    the form's size
    If I say frm.Size = new size (100,100), I think the form will be 100x100 pixels. But what I want is to have the form's client size to be 100x100 (which is the form's size excluding the title bar's size)
    unfortunatly you cant assign a value to form.clientsize
    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!!

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Is this what you want ?
    VB Code:
    1. Me.ClientSize = New System.Drawing.Size(Me.ClientSize.Width, Me.ClientSize.Height)
    2.  
    3.         'or
    4.  
    5. Me.ClientSize = New System.Drawing.Size(100, 100)

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Pirate
    Is this what you want ?
    VB Code:
    1. Me.ClientSize = New System.Drawing.Size(Me.ClientSize.Width, Me.ClientSize.Height)
    2.  
    3.         'or
    4.  
    5. Me.ClientSize = New System.Drawing.Size(100, 100)
    YOU CAN DO THAT>?!!! WAA
    why did I think ClientSize is readonly? hmm!!!! I gotto get home and try it then you better be right or I'll kill you (if you ARE right, then I should kill myself )
    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!!

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I'm afraid you'll get it right and you still insist to kill Pirate ...................

    anways , you could tried something like this :

    VB Code:
    1. Dim siz As New Size(100, 100)
    2.         Me.ClientSize = siz

  7. #7

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aaah this isnt working
    I set the form's size like this:

    me.clientsize = someBitmap.size

    I check the clientSize of the form with the immediate window, and it matches the bitmap's size. But it doesnt look like it really does match it. The height seems ok, but the width is a bit larger for some reason. Here, see it for yourself:
    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!!

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I don't get it , but it works good here . Maybe you implementing it different way . I don't know. see the image below :
    Attached Images Attached Images  

  9. #9

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm tnx you forced me to make another form and try it in there....
    the problem I think was that I was doing that code in the New constructor... when I put it in LOAD it works fine


    edit: ok actually it was something else, now this stupid autoscroll feature of the form is driving me crazy
    Last edited by MrPolite; Sep 13th, 2003 at 08:49 PM.
    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!!

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