c# - Replacing obsolete VisualBasic.Compatibility.VB6.Support -
we have upgraded old vb6 windows app c# .net 4.0. looking replace references microsoft.visualbasic.compatibility.vb6.support class, visual basic 2010 warning me 'microsoft.visualbasic.compatibility.* classes obsolete , supported within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862'
this article assures me that: 'functions in compatibility namespaces created work around shortcomings in version 1.0 of .net framework. in cases, functionality added in later framework versions can used rewrite functions, resulting in improved performance.'
my question is, additions later framework versions need use away compatibility.* classes? need phase out twipstopixelx, twipstopixely, , forth. also, fontchangeunderline, fontchangesize, , other font-related stuff.
the font related functions can replaced enough. example:
function fontchangebold(f font, bold boolean) font dim alreadyset = (f.style , fontstyle.bold) = fontstyle.bold if bold = alreadyset return f if bold return new font(f, f.style or fontstyle.bold) return new font(f, f.style , not fontstyle.bold) end function
this checks whether desired style set. if is, returns old font. otherwise return new font has same style, except bold
style, set according requirement.
Comments
Post a Comment