Notifications
Clear all
[Closed] Hyperlink imgtag / button possible?
Aug 21, 2013 1:25 am
Hi, is it possible to have an image that works like an hyper link so when you click it the web browser opens and goes to the specified address?
Current code…
rollout imagebuttonlink "Image Button Link"
(
local bm1 = openbitmap "C:\image.jpg"
imgtag logobitmapBm1 "imgtag" bitmap:bm1 align:#left
on logobitmapBm1 click do (
print "click"
--would like to have go to address...
)
on logobitmapBm1 mouseover do (
print "over"
)
-----
--Regular Hyper link
hyperLink theName "Autodesk" address:"http://www.autodesk.com" color:[255,255,255]
)
createdialog imagebuttonlink
Thanks in advance, all help is appreciated (:
4 Replies
1 Reply
after the autodesk integrated .net into MAX everything is possible. EVERYTHING! except for… but it’s a different story.
Aug 21, 2013 1:25 am
shellLaunch test:
rollout test "inet"
(
local
bmred = bitmap 140 20 color:red,
bmgreen = bitmap 140 20 color:green
imgtag imagbtn "imgtag" bitmap:bmgreen align:#left
on imagbtn mouseover do imagbtn.bitmap = bmred
on imagbtn mouseout do imagbtn.bitmap = bmgreen
on imagbtn click do
(
ShellLaunch "http:\\\\www.google.com\\" ""
)
)
CreateDialog test
Aug 21, 2013 1:25 am
here is an example:
try(form.close()) catch()
form = dotnetobject "MaxCustomControls.Maxform"
(
form.text = "Link Label Example by denisT"
form.Size = dotnetobject "System.Drawing.Size" 310 120
mh = dotnetobject "LinkLabel"
mh.Text = "Visit Autodesk. Visit CGTalk."
mh.AutoSize = on
mh.links.add 6 8 "http://www.autodesk.com/"
mh.links.add 23 6 "http://www.cgsociety.org/"
mh.Dock = mh.Dock.Top
fn onLinkClicked s e =
(
s.links.item[s.links.IndexOf e.link].Visited = on
(dotnetclass "System.Diagnostics.Process").Start e.link.LinkData
)
dotnet.addeventhandler mh "LinkClicked" onLinkClicked
ih = dotnetobject "LinkLabel"
ih.Size = dotnetobject "System.Drawing.Size" 32 32
icon = dotnetobject "System.Drawing.Icon" (getdir #ui + @"icons\file_3dsmax_3ds.ico")
ih.Image = icon.ToBitmap()
ih.Dock = ih.Dock.Left
fn onImageClicked s e =
(
s.LinkVisited = on
(dotnetclass "System.Diagnostics.Process").Start "http://www.autodesk.com/products/autodesk-3ds-max"
)
dotnet.addeventhandler ih "Click" onImageClicked
form.controls.addrange #(ih, mh)
)
form.ShowModeless()