Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  How to transfer values bewteen Integer and UInt32 types in VB.NET? (Thursday, January 27, 2005)




Found the following interesting discussion in the Newsgroups:

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

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



 Reply:
by:Jay B. Harlow [MVP - Outlook]

 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


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

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

--
Herfried K. Wagner [MVP]








 
Previous Posts
    - How to transfer values between Integer and UInt32 ...
    - How to set file persmissions with WMI using a UNC ...
    - Week date
    - How to set a dataset date value to null
    - If only MSDN examples would actually work!
    - How to use managed code in Office 2003
    - Click Event not fired
    - How to read a particular setting from a file
    - Distinct groupid
    - How to pass Control Parameters between Forms

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland