How to use DrawString outside the form vb.net -
hi wondering how utilize drawstring outside form can see coordinates of mouse when form closed.
can help?
you need form draw on. trick create form except text invisible. can done using forms backcolor
, transparencykey
properties. take form example.
public class form1 dim withevents timer new timer {.interval = 500} private sub form1_load(sender object, e eventargs) handles mybase.load me.backcolor = color.pink me.transparencykey = color.pink me.topmost = true me.formborderstyle = windows.forms.formborderstyle.none timer.start() end sub private sub timer_tick(sender object, e eventargs) handles timer.tick using g graphics = me.creategraphics g.clear(color.pink) g.drawstring(mouseposition.tostring, new font("arial", 20), brushes.red, new pointf(10, 10)) end using end sub end class
every color on form has transparencykey
color transparent. makes text draw on form visible. set topmost
property maintain form dropping behind other applications.
vb.net
No comments:
Post a Comment