28567

how to do addition of textbox values(Integers) on Lost Focus Property and Show it in TextBlock

Question:

I have many Textboxes and I want to Add the Values(Sum of Integers) of Textboxes and Show it in a textblock on Lost Focus Property.... For example:

I fill a Textbox with integer 5, the value of Textblock Changes to 5.... And after that I fill another Textbox with 4... Textblock changes to 9.

I short How can I bind single TextBlock to Multiple Textboxes with Lost_Focus Property?

Please Answer I cannot find it anywhere on Web.

Answer1:

My Dear, In this way you can easily add textboxes in textblock keep

int sum=0; private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { sum = sum + Convert.ToInt32(_1.Text); Add.Text = sum.ToString(); } private void TextBox_TextChanged_1(object sender, TextChangedEventArgs e) { sum = sum + Convert.ToInt32(_2.Text); Add.Text = sum.ToString(); }

Recommend

  • Moving location of Expander expansion button wpf
  • How can I bind a string to double in WPF?
  • Silverlight DataGrid validation show validation error for all objects|properties
  • Can I use PropertyChanged and LostFocus together?
  • Zend Framework 2 - Building a simple form with Validators
  • How to extract a plane from a 3D variable in FiPy (3D to 2D)
  • Unable to get CAP_CHOWN and CAP_DAC_OVERRIDE working for regular user
  • touchstart in JavaScript no longer returns TouchList
  • Angular2 & SystemJS : Cannot find module while building a moduleLoader
  • Multibinding Multiselection ListView
  • Why does IE8 fail to resolve my JQuery selector for a checked radio option?
  • Rails AREL .where statement
  • c++ search a vector for element first seen position
  • Unix Network Programming Clarification
  • How can I reset dropdown data if modal closed on vue component?
  • Get the pasted content on document on paste event
  • Find 5 consecutive numbers in numpy array by row, ignore duplicates
  • Is it possible to define rest argument in OCaml?
  • Knockout custom binding handler
  • Regex to match a string not followed by anything
  • How do I signal completion of my dataflow?
  • Eliminate partial duplicate rows from result set
  • Convert Type Decimal to Hex (string) in .NET 3.5
  • Z3: Convert between FP and BitVector?
  • What is the purpose of TaskExecutor in spring?
  • MySQL Order by column = x, column asc?
  • Date Conversion from yyyy-mm-dd to dd-mm-yyyy
  • Parsing a CSV string while ignoring commas inside the individual columns
  • Is it possible to access block's scope in method?
  • Avoid links criss cross / overlap in d3.js using force layout
  • Repeat a vertical line on every page in Report Builder / SSRS
  • Android screen density dpi vs ppi
  • jQuery show() function is not executed in Safari if submit handler returns true
  • Counter field in MS Access, how to generate?
  • Bug in WPF DataGrid
  • Convert array of 8 bytes to signed long in C++
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How to get Windows thread pool to call class member function?
  • Is there any way to bind data to data.frame by some index?
  • java string with new operator and a literal