Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > API and Miscellaneous Code Examples

Convert integer to Hex

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Convert integer to Hex 'make a form with a commondialog.control 'make a command.control named cmdColor Sub cmdColor_Click() dim RedValue, GreenValue, BlueValue dim AColor 'see help on Flags for settings CMDialog1.Flags = &H1& Or &H4& 'action 3 means show colorpalette CMDialog1.Action = 3 'when you press OKE the color will be put into the variable AColor AColor = CMDialog1.Color RedValue = (ACOLOR And &HFF&) GreenValue = (ACOLOR And &HFF00&) \ 256 BlueValue = (ACOLOR And &HFF0000) \ 65536 ChoosenColor = Format(Hex(RedValue) & Hex(GreenValue) & Hex(BlueValue), "000000") msgbox ChoosenColor End Sub Return