home *** CD-ROM | disk | FTP | other *** search
/ Tools en Utilities / CDASS_5.ISO / shell / windows / vbwiz120.arj / VBWIZUR.ZIP / CLIPCODE.CL_ / CLIPCODE.CL
Encoding:
INI File  |  1994-11-01  |  23.8 KB  |  707 lines

  1. [1]
  2. FrameControl is used to draw frames around controls. Pass it: the name of the form, the name of the control, the offset, and the width of the frame. 5 is a good offset, 1 or 2 a good width.
  3.  
  4. [Code]
  5. 'Declares for FrameControl
  6. Global Const HiColor = &HFFFFFF
  7. Global Const LoColor = &H808080
  8.  
  9. Sub FrameControl (F As Form, C As Control, OffSet As Integer, Width As Integer)
  10. F.DrawWidth = Width
  11. F.forecolor = &HFFFFFF
  12. 'bottom:
  13. F.Line (C.Left, C.Top + C.Height + Offset)-(C.Left + C.Width, C.Top + C.Height + Offset)
  14. 'right:
  15. F.Line (C.Left + C.Width + Offset, C.Top)-(C.Left + C.Width + Offset, C.Top + C.Height + Offset)
  16. F.forecolor = &H808080
  17. 'top:
  18. F.Line (C.Left - Offset * 1.5, C.Top - Offset * 1.5)-(C.Left + C.Width + Offset * 1.5, C.Top - Offset * 1.5)
  19. 'left:
  20. F.Line (C.Left - Offset * 1.5, C.Top - Offset * 1.5)-(C.Left - Offset * 1.5, C.Top + C.Height + Offset)
  21. End Sub
  22. [Stop]
  23. [2]
  24. CenterForm centers the form passed to it horizontally and vertically on the screen. 
  25. [Code]
  26. Sub CenterForm (F As Form)
  27. F.Left = (Screen.Width - F.Width) / 2
  28. F.Top = (Screen.Height - F.Height) / 2
  29. End Sub
  30. [Stop]
  31. [3]
  32. Global Clip
  33. [Code]
  34. Global Clip
  35.  
  36.  
  37. 'Declares for Global Clip
  38. ' Visual Basic global constant file. This file can be loaded
  39. ' into a code module.
  40. '
  41. ' Some constants are commented out because they have
  42. ' duplicates (e.g., NONE appears several places).
  43. '
  44. ' If you are updating a Visual Basic application written with
  45. ' an older version, you should replace your global constants
  46. ' with the constants in this file.
  47. '
  48. ''''''''''''''''''''''''''''
  49.  
  50. ' General
  51.  
  52. ' Clipboard formats
  53. Global Const CF_LINK = &HBF00
  54. Global Const CF_TEXT = 1
  55. Global Const CF_BITMAP = 2
  56. Global Const CF_METAFILE = 3
  57. Global Const CF_DIB = 8
  58. Global Const CF_PALETTE = 9
  59.  
  60. ' DragOver
  61. Global Const ENTER = 0
  62. Global Const LEAVE = 1
  63. Global Const OVER = 2
  64.  
  65. ' Drag (controls)
  66. Global Const CANCEL = 0
  67. Global Const BEGIN_DRAG = 1
  68. Global Const END_DRAG = 2
  69.  
  70. ' Show parameters
  71. Global Const MODAL = 1
  72. Global Const MODELESS = 0
  73.  
  74. ' Arrange Method
  75. ' for MDI Forms
  76. Global Const CASCADE = 0
  77. Global Const TILE_HORIZONTAL = 1
  78. Global Const TILE_VERTICAL = 2
  79. Global Const ARRANGE_ICONS = 3
  80.  
  81. 'ZOrder Method
  82. Global Const BRINGTOFRONT = 0
  83. Global Const SENDTOBACK = 1
  84.  
  85. ' Key Codes
  86. Global Const KEY_LBUTTON = &H1
  87. Global Const KEY_RBUTTON = &H2
  88. Global Const KEY_CANCEL = &H3
  89. Global Const KEY_MBUTTON = &H4    ' NOT contiguous with L & RBUTTON
  90. Global Const KEY_BACK = &H8
  91. Global Const KEY_TAB = &H9
  92. Global Const KEY_CLEAR = &HC
  93. Global Const KEY_RETURN = &HD
  94. Global Const KEY_SHIFT = &H10
  95. Global Const KEY_CONTROL = &H11
  96. Global Const KEY_MENU = &H12
  97. Global Const KEY_PAUSE = &H13
  98. Global Const KEY_CAPITAL = &H14
  99. Global Const KEY_ESCAPE = &H1B
  100. Global Const KEY_SPACE = &H20
  101. Global Const KEY_PRIOR = &H21
  102. Global Const KEY_NEXT = &H22
  103. Global Const KEY_END = &H23
  104. Global Const KEY_HOME = &H24
  105. Global Const KEY_LEFT = &H25
  106. Global Const KEY_UP = &H26
  107. Global Const KEY_RIGHT = &H27
  108. Global Const KEY_DOWN = &H28
  109. Global Const KEY_SELECT = &H29
  110. Global Const KEY_PRINT = &H2A
  111. Global Const KEY_EXECUTE = &H2B
  112. Global Const KEY_SNAPSHOT = &H2C
  113. Global Const KEY_INSERT = &H2D
  114. Global Const KEY_DELETE = &H2E
  115. Global Const KEY_HELP = &H2F
  116.  
  117. ' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  118. ' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
  119.  
  120. Global Const KEY_NUMPAD0 = &H60
  121. Global Const KEY_NUMPAD1 = &H61
  122. Global Const KEY_NUMPAD2 = &H62
  123. Global Const KEY_NUMPAD3 = &H63
  124. Global Const KEY_NUMPAD4 = &H64
  125. Global Const KEY_NUMPAD5 = &H65
  126. Global Const KEY_NUMPAD6 = &H66
  127. Global Const KEY_NUMPAD7 = &H67
  128. Global Const KEY_NUMPAD8 = &H68
  129. Global Const KEY_NUMPAD9 = &H69
  130. Global Const KEY_MULTIPLY = &H6A
  131. Global Const KEY_ADD = &H6B
  132. Global Const KEY_SEPARATOR = &H6C
  133. Global Const KEY_SUBTRACT = &H6D
  134. Global Const KEY_DECIMAL = &H6E
  135. Global Const KEY_DIVIDE = &H6F
  136. Global Const KEY_F1 = &H70
  137. Global Const KEY_F2 = &H71
  138. Global Const KEY_F3 = &H72
  139. Global Const KEY_F4 = &H73
  140. Global Const KEY_F5 = &H74
  141. Global Const KEY_F6 = &H75
  142. Global Const KEY_F7 = &H76
  143. Global Const KEY_F8 = &H77
  144. Global Const KEY_F9 = &H78
  145. Global Const KEY_F10 = &H79
  146. Global Const KEY_F11 = &H7A
  147. Global Const KEY_F12 = &H7B
  148. Global Const KEY_F13 = &H7C
  149. Global Const KEY_F14 = &H7D
  150. Global Const KEY_F15 = &H7E
  151. Global Const KEY_F16 = &H7F
  152.  
  153. Global Const KEY_NUMLOCK = &H90
  154.  
  155. ' Variant VarType tags
  156.  
  157. Global Const V_EMPTY = 0
  158. Global Const V_NULL = 1
  159. Global Const V_INTEGER = 2
  160. Global Const V_LONG = 3
  161. Global Const V_SINGLE = 4
  162. Global Const V_DOUBLE = 5
  163. Global Const V_CURRENCY = 6
  164. Global Const V_DATE = 7
  165. Global Const V_STRING = 8
  166.  
  167.  
  168. ' Event Parameters
  169.  
  170. ' ErrNum (LinkError)
  171. Global Const WRONG_FORMAT = 1
  172. Global Const DDE_SOURCE_CLOSED = 6
  173. Global Const TOO_MANY_LINKS = 7
  174. Global Const DATA_TRANSFER_FAILED = 8
  175.  
  176. ' QueryUnload
  177. Global Const FORM_CONTROLMENU = 0
  178. Global Const FORM_CODE = 1
  179. Global Const APP_WINDOWS = 2
  180. Global Const APP_TASKMANAGER = 3
  181. Global Const FORM_MDIFORM = 4
  182.  
  183. ' Properties
  184.  
  185. ' Colors
  186. Global Const BLACK = &H0&
  187. Global Const RED = &HFF&
  188. Global Const GREEN = &HFF00&
  189. Global Const YELLOW = &HFFFF&
  190. Global Const BLUE = &HFF0000
  191. Global Const MAGENTA = &HFF00FF
  192. Global Const CYAN = &HFFFF00
  193. Global Const WHITE = &HFFFFFF
  194.  
  195. ' System Colors
  196. Global Const SCROLL_BARS = &H80000000           ' Scroll-bars gray area.
  197. Global Const DESKTOP = &H80000001               ' Desktop.
  198. Global Const ACTIVE_TITLE_BAR = &H80000002      ' Active window caption.
  199. Global Const INACTIVE_TITLE_BAR = &H80000003    ' Inactive window caption.
  200. Global Const MENU_BAR = &H80000004              ' Menu background.
  201. Global Const WINDOW_BACKGROUND = &H80000005     ' Window background.
  202. Global Const WINDOW_FRAME = &H80000006          ' Window frame.
  203. Global Const MENU_TEXT = &H80000007             ' Text in menus.
  204. Global Const WINDOW_TEXT = &H80000008           ' Text in windows.
  205. Global Const TITLE_BAR_TEXT = &H80000009        ' Text in caption, size box, scroll-bar arrow box..
  206. Global Const ACTIVE_BORDER = &H8000000A         ' Active window border.
  207. Global Const INACTIVE_BORDER = &H8000000B       ' Inactive window border.
  208. Global Const APPLICATION_WORKSPACE = &H8000000C ' Background color of multiple document interface (MDI) applications.
  209. Global Const HIGHLIGHT = &H8000000D             ' Items selected item in a control.
  210. Global Const HIGHLIGHT_TEXT = &H8000000E        ' Text of item selected in a control.
  211. Global Const BUTTON_FACE = &H8000000F           ' Face shading on command buttons.
  212. Global Const BUTTON_SHADOW = &H80000010         ' Edge shading on command buttons.
  213. Global Const GRAY_TEXT = &H80000011             ' Grayed (disabled) text.  This color is set to 0 if the current display driver does not support a solid gray color.
  214. Global Const BUTTON_TEXT = &H80000012           ' Text on push buttons.
  215.  
  216. ' Enumerated Types
  217.  
  218. ' Align (picture box)
  219. Global Const NONE = 0
  220. Global Const ALIGN_TOP = 1
  221. Global Const ALIGN_BOTTOM = 2
  222.  
  223. ' Alignment
  224. Global Const LEFT_JUSTIFY = 0  ' 0 - Left Justify
  225. Global Const RIGHT_JUSTIFY = 1 ' 1 - Right Justify
  226. Global Const CENTER = 2        ' 2 - Center
  227.  
  228. ' BorderStyle (form)
  229. 'Global Const NONE = 0          ' 0 - None
  230. Global Const FIXED_SINGLE = 1   ' 1 - Fixed Single
  231. Global Const SIZABLE = 2        ' 2 - Sizable (Forms only)
  232. Global Const FIXED_DOUBLE = 3   ' 3 - Fixed Double (Forms only)
  233.  
  234. ' BorderStyle (Shape and Line)
  235. 'Global Const TRANSPARENT = 0    '0 - Transparent
  236. 'Global Const SOLID = 1          '1 - Solid
  237. 'Global Const DASH = 2         ' 2 - Dash
  238. 'Global Const DOT = 3          ' 3 - Dot
  239. 'Global Const DASH_DOT = 4     ' 4 - Dash-Dot
  240. 'Global Const DASH_DOT_DOT = 5 ' 5 - Dash-Dot-Dot
  241. 'Global Const INSIDE_SOLID = 6 ' 6 - Inside Solid
  242.  
  243. ' MousePointer
  244. Global Const DEFAULT = 0        ' 0 - Default
  245. Global Const ARROW = 1          ' 1 - Arrow
  246. Global Const CROSSHAIR = 2      ' 2 - Cross
  247. Global Const IBEAM = 3          ' 3 - I-Beam
  248. Global Const ICON_POINTER = 4   ' 4 - Icon
  249. Global Const SIZE_POINTER = 5   ' 5 - Size
  250. Global Const SIZE_NE_SW = 6     ' 6 - Size NE SW
  251. Global Const SIZE_N_S = 7       ' 7 - Size N S
  252. Global Const SIZE_NW_SE = 8     ' 8 - Size NW SE
  253. Global Const SIZE_W_E = 9       ' 9 - Size W E
  254. Global Const UP_ARROW = 10      ' 10 - Up Arrow
  255. Global Const HOURGLASS = 11     ' 11 - Hourglass
  256. Global Const NO_DROP = 12       ' 12 - No drop
  257.  
  258. ' DragMode
  259. Global Const MANUAL = 0    ' 0 - Manual
  260. Global Const AUTOMATIC = 1 ' 1 - Automatic
  261.  
  262. ' DrawMode
  263. Global Const BLACKNESS = 1      ' 1 - Blackness
  264. Global Const NOT_MERGE_PEN = 2  ' 2 - Not Merge Pen
  265. Global Const MASK_NOT_PEN = 3   ' 3 - Mask Not Pen
  266. Global Const NOT_COPY_PEN = 4   ' 4 - Not Copy Pen
  267. Global Const MASK_PEN_NOT = 5   ' 5 - Mask Pen Not
  268. Global Const INVERT = 6         ' 6 - Invert
  269. Global Const XOR_PEN = 7        ' 7 - Xor Pen
  270. Global Const NOT_MASK_PEN = 8   ' 8 - Not Mask Pen
  271. Global Const MASK_PEN = 9       ' 9 - Mask Pen
  272. Global Const NOT_XOR_PEN = 10   ' 10 - Not Xor Pen
  273. Global Const NOP = 11           ' 11 - Nop
  274. Global Const MERGE_NOT_PEN = 12 ' 12 - Merge Not Pen
  275. Global Const COPY_PEN = 13      ' 13 - Copy Pen
  276. Global Const MERGE_PEN_NOT = 14 ' 14 - Merge Pen Not
  277. Global Const MERGE_PEN = 15     ' 15 - Merge Pen
  278. Global Const WHITENESS = 16     ' 16 - Whiteness
  279.  
  280. ' DrawStyle
  281. Global Const SOLID = 0        ' 0 - Solid
  282. Global Const DASH = 1         ' 1 - Dash
  283. Global Const DOT = 2          ' 2 - Dot
  284. Global Const DASH_DOT = 3     ' 3 - Dash-Dot
  285. Global Const DASH_DOT_DOT = 4 ' 4 - Dash-Dot-Dot
  286. Global Const INVISIBLE = 5    ' 5 - Invisible
  287. Global Const INSIDE_SOLID = 6 ' 6 - Inside Solid
  288.  
  289. ' FillStyle
  290. ' Global Const SOLID = 0           ' 0 - Solid
  291. Global Const TRANSPARENT = 1       ' 1 - Transparent
  292. Global Const HORIZONTAL_LINE = 2   ' 2 - Horizontal Line
  293. Global Const VERTICAL_LINE = 3     ' 3 - Vertical Line
  294. Global Const UPWARD_DIAGONAL = 4   ' 4 - Upward Diagonal
  295. Global Const DOWNWARD_DIAGONAL = 5 ' 5 - Downward Diagonal
  296. Global Const CROSS = 6             ' 6 - Cross
  297. Global Const DIAGONAL_CROSS = 7    ' 7 - Diagonal Cross
  298.  
  299. ' LinkMode (forms and controls)
  300. ' Global Const NONE = 0         ' 0 - None
  301. Global Const LINK_SOURCE = 1    ' 1 - Source (forms only)
  302. Global Const LINK_AUTOMATIC = 1 ' 1 - Automatic (controls only)
  303. Global Const LINK_MANUAL = 2    ' 2 - Manual (controls only)
  304. Global Const LINK_NOTIFY = 3    ' 3 - Notify (controls only)
  305.  
  306. ' LinkMode (kept for VB1.0 compatibility, use new constants instead)
  307. Global Const HOT = 1    ' 1 - Hot (controls only)
  308. Global Const SERVER = 1 ' 1 - Server (forms only)
  309. Global Const COLD = 2   ' 2 - Cold (controls only)
  310.  
  311.  
  312. ' ScaleMode
  313. Global Const USER = 0        ' 0 - User
  314. Global Const TWIPS = 1       ' 1 - Twip
  315. Global Const POINTS = 2      ' 2 - Point
  316. Global Const PIXELS = 3      ' 3 - Pixel
  317. Global Const CHARACTERS = 4  ' 4 - Character
  318. Global Const INCHES = 5      ' 5 - Inch
  319. Global Const MILLIMETERS = 6 ' 6 - Millimeter
  320. Global Const CENTIMETERS = 7 ' 7 - Centimeter
  321.  
  322. ' ScrollBar
  323. ' Global Const NONE     = 0 ' 0 - None
  324. Global Const HORIZONTAL = 1 ' 1 - Horizontal
  325. Global Const VERTICAL = 2   ' 2 - Vertical
  326. Global Const BOTH = 3       ' 3 - Both
  327.  
  328. ' Shape
  329. Global Const SHAPE_RECTANGLE = 0
  330. Global Const SHAPE_SQUARE = 1
  331. Global Const SHAPE_OVAL = 2
  332. Global Const SHAPE_CIRCLE = 3
  333. Global Const SHAPE_ROUNDED_RECTANGLE = 4
  334. Global Const SHAPE_ROUNDED_SQUARE = 5
  335.  
  336. ' WindowState
  337. Global Const NORMAL = 0    ' 0 - Normal
  338. Global Const MINIMIZED = 1 ' 1 - Minimized
  339. Global Const MAXIMIZED = 2 ' 2 - Maximized
  340.  
  341. ' Check Value
  342. Global Const UNCHECKED = 0 ' 0 - Unchecked
  343. Global Const CHECKED = 1   ' 1 - Checked
  344. Global Const GRAYED = 2    ' 2 - Grayed
  345.  
  346. ' Shift parameter masks
  347. Global Const SHIFT_MASK = 1
  348. Global Const CTRL_MASK = 2
  349. Global Const ALT_MASK = 4
  350.  
  351. ' Button parameter masks
  352. Global Const LEFT_BUTTON = 1
  353. Global Const RIGHT_BUTTON = 2
  354. Global Const MIDDLE_BUTTON = 4
  355.  
  356. ' Function Parameters
  357. ' MsgBox parameters
  358. Global Const MB_OK = 0                 ' OK button only
  359. Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  360. Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  361. Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  362. Global Const MB_YESNO = 4              ' Yes and No buttons
  363. Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  364.  
  365. Global Const MB_ICONSTOP = 16          ' Critical message
  366. Global Const MB_ICONQUESTION = 32      ' Warning query
  367. Global Const MB_ICONEXCLAMATION = 48   ' Warning message
  368. Global Const MB_ICONINFORMATION = 64   ' Information message
  369.  
  370. Global Const MB_APPLMODAL = 0          ' Application Modal Message Box
  371. Global Const MB_DEFBUTTON1 = 0         ' First button is default
  372. Global Const MB_DEFBUTTON2 = 256       ' Second button is default
  373. Global Const MB_DEFBUTTON3 = 512       ' Third button is default
  374. Global Const MB_SYSTEMMODAL = 4096      'System Modal
  375.  
  376. ' MsgBox return values
  377. Global Const IDOK = 1                  ' OK button pressed
  378. Global Const IDCANCEL = 2              ' Cancel button pressed
  379. Global Const IDABORT = 3               ' Abort button pressed
  380. Global Const IDRETRY = 4               ' Retry button pressed
  381. Global Const IDIGNORE = 5              ' Ignore button pressed
  382. Global Const IDYES = 6                 ' Yes button pressed
  383. Global Const IDNO = 7                  ' No button pressed
  384.  
  385. ' SetAttr, Dir, GetAttr functions
  386. Global Const ATTR_NORMAL = 0
  387. Global Const ATTR_READONLY = 1
  388. Global Const ATTR_HIDDEN = 2
  389. Global Const ATTR_SYSTEM = 4
  390. Global Const ATTR_VOLUME = 8
  391. Global Const ATTR_DIRECTORY = 16
  392. Global Const ATTR_ARCHIVE = 32
  393.  
  394. 'Grid
  395. 'ColAlignment,FixedAlignment Properties
  396. Global Const GRID_ALIGNLEFT = 0
  397. Global Const GRID_ALIGNRIGHT = 1
  398. Global Const GRID_ALIGNCENTER = 2
  399.  
  400. 'Fillstyle Property
  401. Global Const GRID_SINGLE = 0
  402. Global Const GRID_REPEAT = 1
  403.  
  404.  
  405. 'Data control
  406. 'Error event Response arguments
  407. Global Const DATA_ERRCONTINUE = 0
  408. Global Const DATA_ERRDISPLAY = 1
  409.  
  410. 'Editmode property values
  411. Global Const DATA_EDITNONE = 0
  412. Global Const DATA_EDITMODE = 1
  413. Global Const DATA_EDITADD = 2
  414.  
  415. ' Options property values
  416. Global Const DATA_DENYWRITE = &H1
  417. Global Const DATA_DENYREAD = &H2
  418. Global Const DATA_READONLY = &H4
  419. Global Const DATA_APPENDONLY = &H8
  420. Global Const DATA_INCONSISTENT = &H10
  421. Global Const DATA_CONSISTENT = &H20
  422. Global Const DATA_SQLPASSTHROUGH = &H40
  423.  
  424.  
  425. 'Validate event Action arguments
  426. Global Const DATA_ACTIONCANCEL = 0
  427. Global Const DATA_ACTIONMOVEFIRST = 1
  428. Global Const DATA_ACTIONMOVEPREVIOUS = 2
  429. Global Const DATA_ACTIONMOVENEXT = 3
  430. Global Const DATA_ACTIONMOVELAST = 4
  431. Global Const DATA_ACTIONADDNEW = 5
  432. Global Const DATA_ACTIONUPDATE = 6
  433. Global Const DATA_ACTIONDELETE = 7
  434. Global Const DATA_ACTIONFIND = 8
  435. Global Const DATA_ACTIONBOOKMARK = 9
  436. Global Const DATA_ACTIONCLOSE = 10
  437. Global Const DATA_ACTIONUNLOAD = 11
  438.  
  439.  
  440. 'OLE Control
  441. 'Actions
  442. Global Const OLE_CREATE_EMBED = 0
  443. Global Const OLE_CREATE_NEW = 0           'from ole1 control
  444. Global Const OLE_CREATE_LINK = 1
  445. Global Const OLE_CREATE_FROM_FILE = 1     'from ole1 control
  446. Global Const OLE_COPY = 4
  447. Global Const OLE_PASTE = 5
  448. Global Const OLE_UPDATE = 6
  449. Global Const OLE_ACTIVATE = 7
  450. Global Const OLE_CLOSE = 9
  451. Global Const OLE_DELETE = 10
  452. Global Const OLE_SAVE_TO_FILE = 11
  453. Global Const OLE_READ_FROM_FILE = 12
  454. Global Const OLE_INSERT_OBJ_DLG = 14
  455. Global Const OLE_PASTE_SPECIAL_DLG = 15
  456. Global Const OLE_FETCH_VERBS = 17
  457. Global Const OLE_SAVE_TO_OLE1FILE = 18
  458.  
  459. 'OLEType
  460. Global Const OLE_LINKED = 0
  461. Global Const OLE_EMBEDDED = 1
  462. Global Const OLE_NONE = 3
  463.  
  464. 'OLETypeAllowed
  465. Global Const OLE_EITHER = 2
  466.  
  467. 'UpdateOptions
  468. Global Const OLE_AUTOMATIC = 0
  469. Global Const OLE_FROZEN = 1
  470. Global Const OLE_MANUAL = 2
  471.  
  472. 'AutoActivate modes
  473. 'Note that OLE_ACTIVATE_GETFOCUS only applies to objects that
  474. 'support "inside-out" activation.  See related Verb notes below.
  475. Global Const OLE_ACTIVATE_MANUAL = 0
  476. Global Const OLE_ACTIVATE_GETFOCUS = 1
  477. Global Const OLE_ACTIVATE_DOUBLECLICK = 2
  478.  
  479. 'SizeModes
  480. Global Const OLE_SIZE_CLIP = 0
  481. Global Const OLE_SIZE_STRETCH = 1
  482. Global Const OLE_SIZE_AUTOSIZE = 2
  483.  
  484. 'DisplayTypes
  485. Global Const OLE_DISPLAY_CONTENT = 0
  486. Global Const OLE_DISPLAY_ICON = 1
  487.  
  488. 'Update Event Constants
  489. Global Const OLE_CHANGED = 0
  490. Global Const OLE_SAVED = 1
  491. Global Const OLE_CLOSED = 2
  492. Global Const OLE_RENAMED = 3
  493.  
  494. 'Special Verb Values
  495. Global Const VERB_PRIMARY = 0
  496. Global Const VERB_SHOW = -1
  497. Global Const VERB_OPEN = -2
  498. Global Const VERB_HIDE = -3
  499. Global Const VERB_INPLACEUIACTIVATE = -4
  500. Global Const VERB_INPLACEACTIVATE = -5
  501. 'The last two verbs are for objects that support "inside-out" activation,
  502. 'meaning they can be edited in-place, and that they support being left
  503. 'inplace-active even when the input focus moves to another control or form.
  504. 'These objects actually have 2 levels of being active.  "InPlace Active"
  505. 'means that the object is ready for the user to click inside it and start
  506. 'working with it.  "InPlace UI-Active" means that, in addition, if the object
  507. 'has any other UI associated with it, such as floating palette windows,
  508. 'that those windows are visible and ready for use.  Any number of objects
  509. 'can be "InPlace Active" at a time, although only one can be 
  510. '"InPlace UI-Active".  
  511.  
  512. 'You can cause an object to move to either one of states programmatically by 
  513. 'setting the Verb property to the appropriate verb and setting 
  514. 'Action=OLE_ACTIVATE.  
  515.  
  516. 'Also, if you set AutoActivate = OLE_ACTIVATE_GETFOCUS, the server will 
  517. 'automatically be put into "InPlace UI-Active" state when the user clicks
  518. 'on or tabs into the control.
  519.  
  520. 'VerbFlag Bit Masks 
  521. Global Const VERBFLAG_GRAYED = &H1
  522. Global Const VERBFLAG_DISABLED = &H2
  523. Global Const VERBFLAG_CHECKED = &H8
  524. Global Const VERBFLAG_SEPARATOR = &H800
  525.  
  526. 'MiscFlag Bits - OR these together as desired for special behaviors
  527.  
  528. 'MEMSTORAGE causes the control to use memory to store the object while
  529. '           it is loaded.  This is faster than the default (disk-tempfile),
  530. '           but can consume a lot of memory for objects whose data takes
  531. '           up a lot of space, such as the bitmap for a paint program.
  532. Global Const OLE_MISCFLAG_MEMSTORAGE = &H1
  533.  
  534. 'DISABLEINPLACE overrides the control's default behavior of allowing 
  535. '           in-place activation for objects that support it.  If you
  536. '           are having problems activating an object inplace, you can
  537. '           force it to always activate in a separate window by setting this
  538. '           bit
  539. Global Const OLE_MISCFLAG_DISABLEINPLACE = &H2
  540.  
  541. 'Common Dialog Control
  542. 'Action Property
  543. Global Const DLG_FILE_OPEN = 1
  544. Global Const DLG_FILE_SAVE = 2
  545. Global Const DLG_COLOR = 3
  546. Global Const DLG_FONT = 4
  547. Global Const DLG_PRINT = 5
  548. Global Const DLG_HELP = 6
  549.  
  550. 'File Open/Save Dialog Flags
  551. Global Const OFN_READONLY = &H1&
  552. Global Const OFN_OVERWRITEPROMPT = &H2&
  553. Global Const OFN_HIDEREADONLY = &H4&
  554. Global Const OFN_NOCHANGEDIR = &H8&
  555. Global Const OFN_SHOWHELP = &H10&
  556. Global Const OFN_NOVALIDATE = &H100&
  557. Global Const OFN_ALLOWMULTISELECT = &H200&
  558. Global Const OFN_EXTENSIONDIFFERENT = &H400&
  559. Global Const OFN_PATHMUSTEXIST = &H800&
  560. Global Const OFN_FILEMUSTEXIST = &H1000&
  561. Global Const OFN_CREATEPROMPT = &H2000&
  562. Global Const OFN_SHAREAWARE = &H4000&
  563. Global Const OFN_NOREADONLYRETURN = &H8000&
  564.  
  565. 'Color Dialog Flags
  566. Global Const CC_RGBINIT = &H1&
  567. Global Const CC_FULLOPEN = &H2&
  568. Global Const CC_PREVENTFULLOPEN = &H4&
  569. Global Const CC_SHOWHELP = &H8&
  570.  
  571. 'Fonts Dialog Flags
  572. Global Const CF_SCREENFONTS = &H1&
  573. Global Const CF_PRINTERFONTS = &H2&
  574. Global Const CF_BOTH = &H3&
  575. Global Const CF_SHOWHELP = &H4&
  576. Global Const CF_INITTOLOGFONTSTRUCT = &H40&
  577. Global Const CF_USESTYLE = &H80&
  578. Global Const CF_EFFECTS = &H100&
  579. Global Const CF_APPLY = &H200&
  580. Global Const CF_ANSIONLY = &H400&
  581. Global Const CF_NOVECTORFONTS = &H800&
  582. Global Const CF_NOSIMULATIONS = &H1000&
  583. Global Const CF_LIMITSIZE = &H2000&
  584. Global Const CF_FIXEDPITCHONLY = &H4000&
  585. Global Const CF_WYSIWYG = &H8000&         'must also have CF_SCREENFONTS & CF_PRINTERFONTS
  586. Global Const CF_FORCEFONTEXIST = &H10000
  587. Global Const CF_SCALABLEONLY = &H20000
  588. Global Const CF_TTONLY = &H40000
  589. Global Const CF_NOFACESEL = &H80000
  590. Global Const CF_NOSTYLESEL = &H100000
  591. Global Const CF_NOSIZESEL = &H200000
  592.  
  593. 'Printer Dialog Flags
  594. Global Const PD_ALLPAGES = &H0&
  595. Global Const PD_SELECTION = &H1&
  596. Global Const PD_PAGENUMS = &H2&
  597. Global Const PD_NOSELECTION = &H4&
  598. Global Const PD_NOPAGENUMS = &H8&
  599. Global Const PD_COLLATE = &H10&
  600. Global Const PD_PRINTTOFILE = &H20&
  601. Global Const PD_PRINTSETUP = &H40&
  602. Global Const PD_NOWARNING = &H80&
  603. Global Const PD_RETURNDC = &H100&
  604. Global Const PD_RETURNIC = &H200&
  605. Global Const PD_RETURNDEFAULT = &H400&
  606. Global Const PD_SHOWHELP = &H800&
  607. Global Const PD_USEDEVMODECOPIES = &H40000
  608. Global Const PD_DISABLEPRINTTOFILE = &H80000
  609. Global Const PD_HIDEPRINTTOFILE = &H100000
  610.  
  611. 'Help Constants
  612. Global Const HELP_CONTEXT = &H1           'Display topic in ulTopic
  613. Global Const HELP_QUIT = &H2              'Terminate help
  614. Global Const HELP_INDEX = &H3             'Display index
  615. Global Const HELP_CONTENTS = &H3
  616. Global Const HELP_HELPONHELP = &H4        'Display help on using help
  617. Global Const HELP_SETINDEX = &H5          'Set the current Index for multi index help
  618. Global Const HELP_SETCONTENTS = &H5
  619. Global Const HELP_CONTEXTPOPUP = &H8
  620. Global Const HELP_FORCEFILE = &H9
  621. Global Const HELP_KEY = &H101             'Display topic for keyword in offabData
  622. Global Const HELP_COMMAND = &H102
  623. Global Const HELP_PARTIALKEY = &H105      'call the search engine in winhelp
  624.  
  625. 'Error Constants
  626. Global Const CDERR_DIALOGFAILURE = -32768
  627.  
  628. Global Const CDERR_GENERALCODES =&H7FFF
  629. Global Const CDERR_STRUCTSIZE = &H7FFE
  630. Global Const CDERR_INITIALIZATION = &H7FFD
  631. Global Const CDERR_NOTEMPLATE = &H7FFC
  632. Global Const CDERR_NOHINSTANCE = &H7FFB
  633. Global Const CDERR_LOADSTRFAILURE = &H7FFA
  634. Global Const CDERR_FINDRESFAILURE = &H7FF9
  635. Global Const CDERR_LOADRESFAILURE = &H7FF8
  636. Global Const CDERR_LOCKRESFAILURE = &H7FF7
  637. Global Const CDERR_MEMALLOCFAILURE = &H7FF6
  638. Global Const CDERR_MEMLOCKFAILURE = &H7FF5
  639. Global Const CDERR_NOHOOK = &H7FF4
  640.  
  641. 'Added for CMDIALOG.VBX
  642. Global Const CDERR_CANCEL = &H7FF3
  643. Global Const CDERR_NODLL = &H7FF2
  644. Global Const CDERR_ERRPROC = &H7FF1
  645. Global Const CDERR_ALLOC = &H7FF0
  646. Global Const CDERR_HELP = &H7FEF
  647.  
  648. Global Const PDERR_PRINTERCODES = &H6FFF
  649. Global Const PDERR_SETUPFAILURE = &H6FFE
  650. Global Const PDERR_PARSEFAILURE = &H6FFD
  651. Global Const PDERR_RETDEFFAILURE = &H6FFC
  652. Global Const PDERR_LOADDRVFAILURE = &H6FFB
  653. Global Const PDERR_GETDEVMODEFAIL = &H6FFA
  654. Global Const PDERR_INITFAILURE = &H6FF9
  655. Global Const PDERR_NODEVICES = &H6FF8
  656. Global Const PDERR_NODEFAULTPRN = &H6FF7
  657. Global Const PDERR_DNDMMISMATCH = &H6FF6
  658. Global Const PDERR_CREATEICFAILURE = &H6FF5
  659. Global Const PDERR_PRINTERNOTFOUND = &H6FF4
  660.  
  661. Global Const CFERR_CHOOSEFONTCODES = &H5FFF
  662. Global Const CFERR_NOFONTS = &H5FFE
  663.  
  664. Global Const FNERR_FILENAMECODES = &H4FFF
  665. Global Const FNERR_SUBCLASSFAILURE = &H4FFE
  666. Global Const FNERR_INVALIDFILENAME = &H4FFD
  667. Global Const FNERR_BUFFERTOOSMALL = &H4FFC
  668.  
  669. Global Const FRERR_FINDREPLACECODES = &H3FFF
  670. Global Const CCERR_CHOOSECOLORCODES = &H2FFF
  671.  
  672.  
  673. [Stop]
  674. [4]
  675. ActiveForm Property Example
  676.  
  677. [Code]
  678. ActiveForm Property Example
  679.  
  680.  
  681.  
  682. 'Declares for ActiveForm Property Example
  683.  
  684.  
  685. ActiveForm Property Example
  686.  
  687. The example prints the time on the currently active child form in an MDI form.  To try this example, 
  688. create an MDI form, draw a picture box on it and draw a command button in the picture box.  In 
  689. Form1, set the MDIChild property to True.  (You can also set AutoRedraw to True to keep text on 
  690. the form even after covering it with another form.)  Paste the appropriate code into the Declarations 
  691. section of each form and press F5.
  692.  
  693. ' Copy this code into the MDI form.
  694. Sub MDIForm_Load ()
  695.     Dim NewForm As New Form1    ' Create new instance of Form1.
  696.     NewForm.Show
  697. End Sub
  698.  
  699. ' Copy this code into Form1.
  700. Sub Command1_Click ()
  701.     ' Print the time on the current form.
  702.     ActiveForm.Print "The time is " & Format(Now, "Long Time")
  703. End Sub
  704.  
  705.  
  706. [Stop]
  707.