vb.net - Common class to few forms -
i find nice code making form semi transparent while moving. have multiproject solution 1 project common other , compiles dll referenced projects. code making form semitransparent needed few forms in every project not forms.
i have problem on , how use code used forms. code:
imports system.componentmodel public class clstransform inherits system.windows.forms.form private _opacityresize double = 0.5 private _opacitymove double = 0.5 private _opacityoriginal double private const wm_nclbuttondown long = &ha1 private const wm_nclbuttonup long = &ha0 private const wm_moving long = &h216 private const wm_size long = &h5 protected overrides sub defwndproc(byref m system.windows.forms.message) static lbuttondown boolean if clng(m.msg) = wm_nclbuttondown lbuttondown = true elseif clng(m.msg) = wm_nclbuttonup lbuttondown = false end if if lbuttondown if clng(m.msg) = wm_moving if me.opacity <> _opacitymove _opacityoriginal = me.opacity me.opacity = _opacitymove end if elseif clng(m.msg) = wm_size if me.opacity <> _opacityresize _opacityoriginal = me.opacity me.opacity = _opacityresize end if end if elseif not lbuttondown if me.opacity <> _opacityoriginal me.opacity = _opacityoriginal end if mybase.defwndproc(m) end sub public property opacitymove() double ... etc... public property opacityresize() double ... etc...
i try make class clstransform under common project creates me new form.
how configure class used forms?
, how put it?
i'd suggest making clstransform
abstract marking mustinherit
. then, in other forms, inherit clstransform
instead of system.windows.forms.form
. every form inherits clstransform
have transparency effect.
as put file itself: doesn't matter. don't forget add project reference project contains clstransform
in every project needs use it.
Comments
Post a Comment