Results 1 to 5 of 5

Thread: How to recover a value in a textbox

  1. #1
    Join Date
    Apr 2009
    Posts
    40

    How to recover a value in a textbox

    Hello,

    I am setting up a software with Visual Studio. I have a TextBox where the user will enter a value in decimal. Should I get this value and that I pass in hex. I know that 64hexa = 100decimal but the problem is that I do not know everything in C #. How do I write the code?

    Could you help me please?
    Thank you in advance.

  2. #2
    Join Date
    Dec 2008
    Posts
    183

    Re: How to recover a value in a textbox

    hi,

    To retrieve the value of a textbox, you should do:

    Code:
    int = int valeurEntier. Parse (taTextBox. Text);
    to transform it into hexadecimal:

    Code:
     string hex = String.Format ( "(0: X)", valeurEntier);

  3. #3
    Join Date
    Jan 2009
    Posts
    134

    Re: How to recover a value in a textbox

    I am Not finding anything interesting in using the String.Format method in this case. Thereby making

    Code:
    string hex = valeurEntier. ToString ( "x");

  4. #4
    Join Date
    Apr 2009
    Posts
    40

    Re: How to recover a value in a textbox

    I have little doubt in my mind, What will the X refers to, i have little confusion about it, what should i consider about it.

  5. #5
    Join Date
    Jan 2009
    Posts
    134

    Re: How to recover a value in a textbox

    You are using data binding. If you set TwoWay binding for the TextBox, the value user entered in the box should be automatically update the DataObject that bind to that row.

    <TextBox Text="{Binding Nome, Mode=Two Way}" BorderBrush="Transparent" BorderThickness="0"/>

    If you check the Nome field on you DataObject in the ProgrammazioneDS, you should be able to see the change. You do not need to access the UI element to retrieve that data.

Similar Threads

  1. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  2. Textbox validation in ASP.NET
    By Kasper in forum Software Development
    Replies: 4
    Last Post: 19-01-2010, 08:28 PM
  3. Moving from one TextBox to another with TAB
    By GeforceUser in forum Software Development
    Replies: 3
    Last Post: 05-11-2009, 06:31 PM
  4. Numerical value on TextBox
    By KABIRA16 in forum Software Development
    Replies: 3
    Last Post: 29-10-2009, 04:25 PM
  5. how to hide a textbox in asp.net
    By Alejandro in forum Software Development
    Replies: 2
    Last Post: 10-06-2009, 10:43 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,922,733.80886 seconds with 17 queries