mercoledì 30 marzo 2011 #

VB Tips: Count how many numbers in a double

In community someone asked how to count the numbers of a decimal number. Classic example of how you might use Linq in a single line of code:

Dim DoubleNumber As Double = 54637.3456789
Dim Count As Integer = DoubleNumber.ToString("f").Where(Function(c) Char.IsDigit(c)).Count
HTH
Alberto

posted @ mercoledì 30 marzo 2011 10.18 | Feedback (3)

VB.NET: How to extract icon or image from ImageList

If you need to extract an image from ImageList control use this code:

Bitmap = DirectCast(MyImageList.Images(0), Bitmap)

or if you need an icon:

Me.Icon = Drawing.Icon.FromHandle(DirectCast(MyImageList.Images(0), Bitmap).GetHicon)

Alberto

posted @ mercoledì 30 marzo 2011 10.08 | Feedback (0)

Copyright © Alberto De Luca

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski