Re: resize more than one control proportion

From: Peter Proost (pproost_at_nospam.hotmail.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 15:56:34 +0200

Hi Peiter,

create a new form, size=640;424, than place 2 datagrids on it, datagrid one
at the location 0;0 and size:632;200 and datagrid 2 at location 0;200 and
the same size, then copy paste the following code and see if this is what
you want:

<<<<<code>>>>>>>>

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As
System.EventArgs) _ Handles MyBase.Resize
 DataGrid1.Width = Me.Width - 8
 DataGrid2.Width = Me.Width - 8
 DataGrid2.Height = (Me.Height - 24) / 2
 DataGrid1.Height = (Me.Height - 24) / 2
 DataGrid2.Location = New Point(0, DataGrid1.Height)
End Sub

<<<<<code>>>>>

hth Peter

"DraguVaso" <pietercoucke@hotmail.com> wrote in message
news:#pFNTKzuEHA.3972@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> I have to DataGrid's on a form, one on the top of my form, the other at
the
> bottom, but they though each other somewhere in the middle. What I want
now
> is that, when I resize the form, they resize in the same proportions: So
> when I resize the Form with 50%, they each have to resize with 50%.
>
> The maximum what I can achieve now is that one of them resizes, and the
> other keeps the same height, if I don't do it like that one of the
> DaatGrid's comes in front of the other.
>
> Any help would be really appreciated!
>
> Thansk a lot in advance,
>
> Pieter
>
>



Relevant Pages

  • DataGrid - prevent open space on right
    ... When I create datagrids the user can resize the right-most column ... leaving empty space on the right side. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Cell sizing in a Vlookup formula to fit information.
    ... Could you resize all the usedrange's rowheights each time excel recalculates? ... Option Explicit ... Private Sub Worksheet_Calculate ... Is it possible for a cell to automatically size itself by height to fit the ...
    (microsoft.public.excel.worksheet.functions)
  • Re: UserControl: resizing textbox issue
    ... > Can you resize the UserControl in it's resizeevent handler? ... Private Sub UserControl_Resize ... ...Subtracting 1 or 2 won't do a thing if your scalemode's set to Twips. ...
    (microsoft.public.vb.general.discussion)
  • Re: Resize 2 Forms at Once Like HTML Frames
    ... The user could drag in the middle to resize both ... Private Sub Form_Resize ... Dim xa As Long, xb As Long ... vary with your use of record selectors, scroll bars, ...
    (microsoft.public.access.formscoding)
  • Re: Access 2000 - Keep form maximized
    ... examples that grab the app & form size and resize things but I've never got ... I've tried MS's example of removing the restore button, ... Does anyone have any pointers or sites with examples? ... Private Sub Form_Open ...
    (microsoft.public.access.formscoding)