cannot get a vb6 control with a color function to work in vb.net -


i have vb6 ocx control has function takes, among other things, long set color of label component of control. works fine until use control in vb.net 64bit environment longs ints , color different type anyway.

i tried changing function take 3 ints rgb , using rgb function color use form not load in vb.net environment control on it.

does know how can change control's code in vb6 can used in vb.net?

you can use built in method equivalent color value use in application:

dim mycolor color = color.red  ' translate mycolor ole color.  dim wincolor integer = colortranslator.towin32(mycolor) 

the result int32 long in vb6

so...

in vb6 control can expose color property this:

public property colorvalue long     colorvalue = lblcolor.backcolor end property  public property let colorvalue(value long)     lblcolor.backcolor = value end property 

then in vb.net application can set this:

mycontrol.colorvalue = colortranslator.towin32(color.red) 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -