CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Threaded View

  1. #13
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: *Urgent* Help with VB Code

    **EDIT**
    oppsss...did not see the poster followed the correct suggestion to starta new thread:
    http://www.codeguru.com/forum/showthread.php?t=515352
    *******
    We must help this one... here:
    http://stackoverflow.com/questions/6...l-using-vb-net

    and here: http://www.geekpedia.com/KB8_How-do-...o-decimal.html
    but as the latter is in c#, I translate it for you in a sample solution I attach here.
    Code is
    Code:
    Public Class Form1
        
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'a sample value to show you how your Hex shoudl be as a string 
            TextBox1.Text = 1521.ToString("X")
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim thevalue As Integer
            Dim numberstyle As System.Globalization.NumberStyles
            numberstyle = System.Globalization.NumberStyles.HexNumber
            Try
                thevalue = Integer.Parse(TextBox1.Text, numberstyle)
                TextBox2.Text = thevalue.ToString
            Catch
                MessageBox.Show("Sorry, could not convert " & TextBox1.Text & " to ""decimal"" integer")
            End Try
    
    
        End Sub
    
        
    End Class
    Attached Files Attached Files
    Last edited by Cimperiali; August 12th, 2011 at 03:13 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured