Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 29-04-2009
Member
 
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.
Reply With Quote
  #2  
Old 29-04-2009
Member
 
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);
Reply With Quote
  #3  
Old 29-04-2009
Member
 
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");
Reply With Quote
  #4  
Old 29-04-2009
Member
 
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.
Reply With Quote
  #5  
Old 29-04-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to recover a value in a textbox"
Thread Thread Starter Forum Replies Last Post
Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox Neil Ives Software Development 2 20-08-2010 01:23 AM
Textbox validation in ASP.NET Kasper Software Development 4 19-01-2010 08:28 PM
Moving from one TextBox to another with TAB GeforceUser Software Development 3 05-11-2009 06:31 PM
Numerical value on TextBox KABIRA16 Software Development 3 29-10-2009 04:25 PM
how to hide a textbox in asp.net Alejandro Software Development 2 10-06-2009 10:43 AM


All times are GMT +5.5. The time now is 05:03 PM.