Results 1 to 3 of 3

Thread: API For changing width/height of msflexgrid

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    chennai,tamilnadu,india
    Posts
    29

    Post

    Hi,

    Can any one tell me how to change the width and height of msflexgrid ctrl using API calls.


    Thanks
    Murali

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    chennai,tamilnadu,india
    Posts
    29

    Post

    Hi
    Thank u serge.It is working
    Regards
    Murali

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure. Try this:

    Code:
    Option Explicit
    Private Type RECT
            Left As Long
            Top As Long
            Right As Long
            Bottom As Long
    End Type
    Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
    
    Private Sub Command1_Click()
        Dim rec As RECT
        Dim lHeight As Long
        Dim lWidth As Long
        
        Call GetClientRect(MSFlexGrid1.hwnd, rec)
        lWidth = rec.Right - rec.Left
        lHeight = rec.Bottom - rec.Top
        Call MoveWindow(MSFlexGrid1.hwnd, rec.Left, rec.Top, lWidth * 2, lHeight * 2, True)
    End Sub

    Regards,

    ------------------

    Serge

    Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819


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