home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / VBEMBDMN / AAFRAME.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1993-03-01  |  3.3 KB  |  104 lines

  1. VERSION 2.00
  2. Begin Form MainWindow 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Menu Embedding Demo"
  6.    ClipControls    =   0   'False
  7.    FontBold        =   -1  'True
  8.    FontItalic      =   0   'False
  9.    FontName        =   "System"
  10.    FontSize        =   9
  11.    FontStrikethru  =   0   'False
  12.    FontUnderline   =   0   'False
  13.    Height          =   1455
  14.    Icon            =   AAFRAME.FRX:0000
  15.    KeyPreview      =   -1  'True
  16.    Left            =   2205
  17.    LinkMode        =   1  'Source
  18.    LinkTopic       =   "Form1"
  19.    MaxButton       =   0   'False
  20.    ScaleHeight     =   1020
  21.    ScaleWidth      =   3630
  22.    Top             =   1830
  23.    Width           =   3780
  24.    Begin PictureBox EmbedMenu 
  25.       Height          =   315
  26.       Left            =   1590
  27.       ScaleHeight     =   285
  28.       ScaleWidth      =   1860
  29.       TabIndex        =   1
  30.       Top             =   420
  31.       Width           =   1890
  32.    End
  33.    Begin CommandButton Command1 
  34.       BackColor       =   &H00C0C0C0&
  35.       Caption         =   "E&xit"
  36.       Height          =   315
  37.       Left            =   150
  38.       TabIndex        =   0
  39.       Top             =   420
  40.       Width           =   1245
  41.    End
  42. Sub Command1_Click ()
  43.     Unload MenuForm
  44.     Unload MainWindow  'Dumps the VB form.
  45.     End   'Shuts down the VB app.
  46. End Sub
  47. Sub CtlInit (D As Control, OutIn As Integer)
  48. 'This is for the concave look.
  49. LowLight D, OutIn
  50. End Sub
  51. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  52. Const Alt_Mask = 4
  53. Const Key_E = 69
  54. AltDown = (Shift And Alt_Mask) > 0
  55. If KeyCode = Key_E Then
  56. If AltDown Then
  57. MenuForm.SetFocus
  58. SendKeys "%E"
  59. End If
  60. End If
  61. End Sub
  62. Sub Form_Load ()
  63. 'This sets the defaultwidth of the 3d frames; you can muck
  64. 'with the width in the BAS General Declarations const declaration
  65. 'near the end of the file; it's at 1 now. Higher nos.
  66. 'make it wider.
  67.    FrameWidth = DEFAULTWIDTH
  68.    MainWindow.Show
  69.    'Here we get various stuff useful for embedding the menu form.
  70.    Call GetWindowRect(MainWindow.EmbedMenu.hWnd, lpRect)
  71.    capsize% = GetSystemMetrics(SM_CYCAPTION)
  72.    xbordwidth% = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXBORDER)
  73.    ybordheight% = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYBORDER)
  74.    Load MenuForm
  75.    MenuForm.Show
  76.    'Tell it where it belongs--in the main form's picture box.
  77.    a% = SetParent(MenuForm.hWnd, MainWindow.EmbedMenu.hWnd)
  78.    'Now put it into place.
  79.    Call SetWindowPos(MenuForm.hWnd, 0, -xbordwidth%, -ybordheight%, 500, 3000, SWP_NOZORDER)
  80.    MainWindow.SetFocus  'Return focus to our main window.
  81. End Sub
  82. Sub Form_Paint ()
  83.     'This makes controls convex
  84.     PaintFrames CTLRAISED
  85.     'This makes them concave
  86.     PaintTexts CTLRECESSED
  87.    MenuForm.SetFocus
  88.    SendKeys "%E{ESC 2}"  '"{F10}"
  89.    q% = DoEvents()
  90.    MainWindow.SetFocus  'Return focus to our main window.
  91. End Sub
  92. Sub InitCtl (C As Control, InOut As Integer)
  93. 'This is for the convex look.
  94. Highlight C, InOut
  95. End Sub
  96. Sub PaintFrames (InOut As Integer)
  97. 'Sets each listed control for convex 3D look.
  98. InitCtl Command1, InOut
  99. End Sub
  100. Sub PaintTexts (OutIn As Integer)
  101. 'Sets each listed control for concave 3D look.
  102. CtlInit EmbedMenu, OutIn
  103. End Sub
  104.