• Martes 30 de Abril de 2024, 03:09

Autor Tema:  Convertir hexadecimal en Decimal.  (Leído 1417 veces)

maxstepin

  • Miembro activo
  • **
  • Mensajes: 32
    • Ver Perfil
Convertir hexadecimal en Decimal.
« en: Viernes 16 de Julio de 2010, 22:56 »
0
hola

teniendo este codigo:

Código: Visual Basic
  1. Function HexToLong(ByVal sHex As String) As Long
  2.         HexToLong = Val("&H" & sHex & "&")
  3.       End Function
  4.  
  5. Private Sub txtDecimal_Change()
  6.     txtHexadecimal.Text = Hex(CLng(txtDecimal.Text))
  7.  
  8. End Sub
  9.  
  10. Private Sub txtHexadecimal_Change()
  11.     'txtDecimal.Text = CLng("&h" & txtHexadecimal.Text)
  12.    'Val
  13.    txtDecimal.Text = HexToLong(txtHexadecimal.Text)
  14.  

Porque no me funciona la linea 'txtDecimal.Text = CLng("&h" & txtHexadecimal.Text) sin tener que invocar a la funcion?
Finaliza con error cunado excedo en digitos tanto en un texbox como el otro.

salud