How to transfer values bewteen Integer and UInt32 types in VB.NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The below code always get compile error, "Can not change Integer to UInt32". Then how can I set BackColor property

With txtob
.Name = "txtProductCode
.SetText("Apple"
.BackColor = 8 ' BackColor is UInt32 typ
End Wit
 
Steellock,
I would expect BackColor to be of type Color.

Current versions of VB.NET do not support UInt32 its easiest to avoid them.
If you need to convert to & from them I would recommend the System.Convert
class
.BackColor = Convert.ToUInt32(8) ' BackColor is UInt32
type

Hope this helps
Jay

steellock said:
The below code always get compile error, "Can not change Integer to
UInt32". Then how can I set BackColor property?
 
* =?Utf-8?B?c3RlZWxsb2Nr?= said:
The below code always get compile error, "Can not change Integer to UInt32". Then how can I set BackColor property?

With txtobj
.Name = "txtProductCode"
.SetText("Apple")
.BackColor = 8 ' BackColor is UInt32 type
End With

What's 'txtObj'? You can try '.BackColor = UInt32.Parse(8.ToString())'.
 
Back
Top