home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / SIZECTRL / DEMORESZ.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-03-01  |  3.1 KB  |  88 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    Caption         =   "Resizing other Visual Basic controls at runtime"
  4.    Height          =   4065
  5.    Left            =   1200
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   3570
  8.    ScaleWidth      =   7545
  9.    Top             =   2040
  10.    Width           =   7755
  11.    Begin DirListBox Dir1 
  12.       Height          =   1155
  13.       Left            =   2280
  14.       TabIndex        =   2
  15.       Top             =   2160
  16.       Width           =   2295
  17.    End
  18.    Begin TextBox Text3 
  19.       Height          =   495
  20.       Left            =   16000
  21.       TabIndex        =   3
  22.       Text            =   "Text3"
  23.       Top             =   16000
  24.       Width           =   1215
  25.    End
  26.    Begin TextBox Text2 
  27.       Height          =   1095
  28.       Left            =   3840
  29.       MultiLine       =   -1  'True
  30.       ScrollBars      =   2  'Vertical
  31.       TabIndex        =   1
  32.       Text            =   "Click on me in order to be able to resize me and move me."
  33.       Top             =   960
  34.       Width           =   1575
  35.    End
  36.    Begin TextBox Text1 
  37.       Height          =   975
  38.       Left            =   1560
  39.       MultiLine       =   -1  'True
  40.       ScrollBars      =   2  'Vertical
  41.       TabIndex        =   0
  42.       Text            =   "This is the shape of things to come."
  43.       Top             =   960
  44.       Width           =   1335
  45.    End
  46.    Begin Label Label1 
  47.       Caption         =   "Click on the text in either of the two text boxes, or click on the directory list box, in order to select the box.  Try resizing the selected control by dragging one of its corner handles.  You can click elsewhere on the form to de-select all the controls.  You can also move a selected control by dragging its light blue boundary."
  48.       Height          =   855
  49.       Left            =   0
  50.       TabIndex        =   4
  51.       Top             =   0
  52.       Width           =   7215
  53.    End
  54.    Begin Siz Siz1 
  55.       BackColor       =   &H00FFFF80&
  56.       BorderStyle     =   0  'None
  57.       Height          =   615
  58.       Left            =   120
  59.       Top             =   720
  60.       Width           =   495
  61.    End
  62. Option Explicit
  63. Sub Dir1_GotFocus ()
  64.   'siz1.Visible = False
  65.   'siz1.Left = dir1.Left - 70
  66.   'siz1.Top = dir1.Top - 70
  67.   'siz1.Width = dir1.Width + 140
  68.   'siz1.Height = dir1.Height + 140
  69.   siz1.Visible = True
  70.   siz1.Move form2.ActiveControl.Left - 70, form2.ActiveControl.Top - 70, form2.ActiveControl.Width + 140, form2.ActiveControl.Height + 140
  71. End Sub
  72. Sub Form_Click ()
  73.   siz1.Visible = False
  74.   text3.SetFocus
  75. End Sub
  76. Sub Siz1_Resize (Corner As Integer)
  77.   form2.ActiveControl.Move siz1.Left + 70, siz1.Top + 70, siz1.Width - 140, siz1.Height - 140
  78.   siz1.ZOrder
  79. End Sub
  80. Sub Text1_GotFocus ()
  81.   siz1.Visible = True
  82.   siz1.Move form2.ActiveControl.Left - 70, form2.ActiveControl.Top - 70, form2.ActiveControl.Width + 140, form2.ActiveControl.Height + 140
  83. End Sub
  84. Sub Text2_GotFocus ()
  85.   siz1.Visible = True
  86.   siz1.Move form2.ActiveControl.Left - 70, form2.ActiveControl.Top - 70, form2.ActiveControl.Width + 140, form2.ActiveControl.Height + 140
  87. End Sub
  88.