Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Tag Property Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' The example uses the Tag property to change the backcolor of a picture
' box based upon the Tag of the control that is dragged over it.
' To try this example:
' 1. Choose New Project from the File menu
' 2. Choose New Form from the File menu to create a form with three picture
' box controls
' 3. Set picture box properties:
' • For Picture1, Dragmode = 1 (Automatic), Tag = Pic1
' • For Picture2, Dragmode = 1 (Automatic), Tag = Pic2
' 4. Press Alt+F4 to return to the programming environment
' 5. Copy the code example below to the form module
' 6. Press F5 to run the example
SUB Picture3_DragOver (Source AS CONTROL, X AS SINGLE, Y AS SINGLE, _
State AS INTEGER)
CONST ENTER = 0, LEAVE = 1, OVER = 2
IF State = ENTER THEN
' Select based on Tag since CtlName is not available at run time
SELECT CASE Source.Tag
CASE "Pic1"
Picture3.BackColor = 4
CASE "Pic2"
Picture3.BackColor = 10
END SELECT
ELSEIF State = LEAVE THEN
Source.BackColor = Picture3.BackColor
END IF
END SUB