Link to home
Start Free TrialLog in
Avatar of fmichail
fmichailFlag for Canada

asked on

How to include group of text boxes in a scrollable container

I have a very crowded (have many text boxes) TAB in a TAB control, I want to include a scrollable control (container) where I can move these text boxes and be able within the original TAB to scroll and see all the text boxes.given that all the ways like decreasing the spaces and minimizing font size, changing screen resolution ... are not valid options)
Help Please.
ASKER CERTIFIED SOLUTION
Avatar of RodStephens
RodStephens

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richie_Simonetti
As an example from MSDN:

Private Sub Form_Load()

   ' Establece ScaleMode a píxeles.
   Form1.ScaleMode = vbPixels
   Picture1.ScaleMode = vbPixels

   ' Autosize se establece a True para que los bordes
   ' de Picture2 se ' expandan al tamaño del
   ' mapa de bits real.
   Picture2.AutoSize = True

   ' Establece el BorderStyle de cada cuadro ' de imagen a Ninguno.
   Picture1.BorderStyle = 0
   Picture2.BorderStyle = 0

   ' Carga el mapa de bits.
   Picture2.Picture = _
   LoadPicture("c:\Windows\Winlogo.bmp")

   ' Inicializa la ubicación de ambas imágenes.
   Picture1.Move 0, 0, ScaleWidth - VScroll1.Width, _
   ScaleHeight - HScroll1.Height
   Picture2.Move 0, 0

   ' Coloca la barra de desplazamiento horizontal.
   HScroll1.Top = Picture1.Height
   HScroll1.Left = 0
   HScroll1.Width = Picture1.Width

   ' Coloca la barra de desplazamiento vertical.
   VScroll1.Top = 0
   VScroll1.Left = Picture1.Width
   VScroll1.Height = Picture1.Height

   ' Establece la propiedad Max de las ' barras de desplazamiento.
   HScroll1.Max = Picture2.Width - Picture1.Width
   VScroll1.Max = Picture2.Height - Picture1.Height

   ' Determina si la imagen secundaria cabe en la
   ' pantalla.
   Si es así, no son necesarias las ' barras de desplazamiento.
   VScroll1.Visible = (Picture1.Height < _
   Picture2.Height)
   HScroll1.Visible = (Picture1.Width < _
   Picture2.Width)

End Sub

Private Sub HScroll1_Change()
   Picture2.Left = -HScroll1.Value
End Sub

Private Sub VScroll1_Change()
   Picture2.Top = -VScroll1.Value
End Sub

Private Sub Form_Resize()
   ' Cuando cambia el tamaño del formulario, cambian
   ' las dimensiones de Picture1.
   Picture1.Height = Form1.Height
   Picture1.Width = Form1.Width

   ' Reinicializa la posición de la imagen y de las
   ' barras de desplazamiento.
   Picture1.Move 0, 0, ScaleWidth - VScroll1.Width, _
   ScaleHeight - HScroll1.Height
   Picture2.Move 0, 0
   HScroll1.Top = Picture1.Height
   HScroll1.Left = 0
   HScroll1.Width = Picture1.Width
   VScroll1.Top = 0
   VScroll1.Left = Picture1.Width
   VScroll1.Height = Picture1.Height
   HScroll1.Max = Picture2.Width - Picture1.Width
   VScroll1.Max = Picture2.Height - Picture1.Width

   ' Comprueba si son necesarias las ' barras de desplazamiento.
   VScroll1.Visible = (Picture1.Height < _
   Picture2.Height)
   HScroll1.Visible = (Picture1.Width < _
   Picture2.Width)

End Sub
<ping..>
Avatar of fmichail

ASKER

Thanks RodStephens that was exactly what I wanted

Thanks again