|
Post by MicroPsycho on May 25, 2005 19:21:46 GMT -5
Before I get down to business I would like to comment on cool and interesting this autorun tool is.
Now, i would like images displayed when my mouse moves over an Interactive Label, and for the image to disappear again once the cursor leaves the Interactive Label. I am willing to use a different item if such as a Button if what I wish to do can't be accomplished with an Interactive Label, However, I still need to be able to run files on onclick.
Any help would be appreciated, thanks
|
|
|
Post by Murariu Alexandru on May 26, 2005 13:31:12 GMT -5
Consider having an interactive label named InteractiveLabel1 and an image named Image1. This code gives you what you want:
procedure InteractiveLabel1OnMouseEnter(Sender: TObject); begin Image1.Show; end;
procedure InteractiveLabel1OnMouseLeave(Sender: TObject); begin Image1.Hide; end;
Also you may need to know that you can run files from anywhere in script using the ShellExec or FileExec or FileExecEx (see their descriptions and examples in help).
|
|
|
Post by MicroPsycho on May 28, 2005 15:19:42 GMT -5
thanks, but unfortunately that code doesn't work
|
|
|
Post by Murariu Alexandru on May 29, 2005 12:33:18 GMT -5
It works just fine for me. Here's a test project.
Start a new project, Then copy the code below:
procedure InteractiveLabel1OnMouseEnter(Sender: TObject); begin Image1.Show; end;
procedure InteractiveLabel1OnMouseLeave(Sender: TObject); begin Image1.Hide; end;
Save the following lines to a file named form1.dfm then right click on the form (menu Form -> Load Form From File and select that file).
object Form1: TForm Left = 0 Top = 0 Width = 352 Height = 96 Caption = 'Test' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False Visible = True PixelsPerInch = 96 TextHeight = 13 object InteractiveLabel1: TInteractiveLabel Left = 16 Top = 16 Width = 145 Height = 16 Cursor = crHandPoint Caption = 'Move Mouse Over ME ...' ColorNormal = clBlack ColorOnMouseOver = 16737843 ColorOnMouseClick = clRed Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False Transparent = True end object Image1: TImage Left = 184 Top = 16 Width = 105 Height = 17 Picture.Data = { 0954474946496D616765474946383761670010007700002C0000000067001000 870000000000330000660000990000CC0000FF00330000333300336600339900 33CC0033FF0066000066330066660066990066CC0066FF009900009933009966 0099990099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF0000FF 3300FF6600FF9900FFCC00FFFF3300003300333300663300993300CC3300FF33 33003333333333663333993333CC3333FF3366003366333366663366993366CC 3366FF3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC 9933CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF66000066003366 00666600996600CC6600FF6633006633336633666633996633CC6633FF666600 6666336666666666996666CC6666FF6699006699336699666699996699CC6699 FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF3366FF6666FF9966 FFCC66FFFF9900009900339900669900999900CC9900FF993300993333993366 9933999933CC9933FF9966009966339966669966999966CC9966FF9999009999 339999669999999999CC9999FF99CC0099CC3399CC6699CC9999CCCC99CCFF99 FF0099FF3399FF6699FF9999FFCC99FFFFCC0000CC0033CC0066CC0099CC00CC CC00FFCC3300CC3333CC3366CC3399CC33CCCC33FFCC6600CC6633CC6666CC66 99CC66CCCC66FFCC9900CC9933CC9966CC9999CC99CCCC99FFCCCC00CCCC33CC CC66CCCC99CCCCCCCCCCFFCCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0000 FF0033FF0066FF0099FF00CCFF00FFFF3300FF3333FF3366FF3399FF33CCFF33 FFFF6600FF6633FF6666FF6699FF66CCFF66FFFF9900FF9933FF9966FF9999FF 99CCFF99FFFFCC00FFCC33FFCC66FFCC99FFCCCCFFCCFFFFFF00FFFF33FFFF66 FFFF99FFFFCCFFFFFF0000000000000000000000000000000000000000000000 00000000000000000000CC00203F9B543F9B540001100000000000004C3F3C4C 3F3C0000FC0000000000003F9B7C3F9B7C0000E800216E3F868000000000000D 0000000000003F9BA03F9BA00000C44CE99842C74C4CE9980000000000000000 0008CA0023081C48B0A0C18308132A5CC8B0A1C38710234A9C48B1A2C58B1813 52DBC831C2C6821F1586CC3832A34884234B9A5CC97220B5832939BEF4385326 C89A1D6FE2CCE9F2A5CC9F3D67D2CC69936048A146851EF5C95460C98F4B8D3A 6D4A3369D5AB50A762A5FA14A7C1985AA1F2EC39146950AE48C56ADDAAB6EA4F B3646FC66D5BD6EAD4AE6EBD928D9AB7AF5F9170C1F6E51B566FE1AD56F9AA6D CB38ADE1B88897AA941CB82361BF8A89162D3AB7A5678B4AE1A214FDB93443CE A74DAB5ECDBAB5EBD7B02F0604003B} Visible = False end end
|
|