Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Listbox Hatch Pin
Heath Stewart2-May-04 6:46
protectorHeath Stewart2-May-04 6:46 
GeneralRe: Listbox Hatch Pin
"joel"2-May-04 20:27
"joel"2-May-04 20:27 
GeneralTextBox calculations on the fly. Pin
FredSP2-May-04 4:36
FredSP2-May-04 4:36 
GeneralRe: TextBox calculations on the fly. Pin
Dave Kreskowiak2-May-04 4:40
mveDave Kreskowiak2-May-04 4:40 
GeneralRe: TextBox calculations on the fly. Pin
FredSP2-May-04 16:49
FredSP2-May-04 16:49 
GeneralRe: TextBox calculations on the fly. Pin
Heath Stewart2-May-04 6:42
protectorHeath Stewart2-May-04 6:42 
GeneralRe: TextBox calculations on the fly. Pin
FredSP2-May-04 16:45
FredSP2-May-04 16:45 
GeneralRe: TextBox calculations on the fly. Pin
..Hubert..3-May-04 1:17
..Hubert..3-May-04 1:17 
Heath Stewart wrote:
TextChanged is probably best for this, but keep in mind that it isn't fired till the TextBox loses focus.

Text changed is fired whenever text is changed in the control (by either programmatic modification or user interaction). I think, you tought about Validating event which is truly raised when control loses focus.

But talking about textboxes and calculations...
You can:
1. Create data table as spoken above. But - do you want two way calculations? It means if user enter Rate and Amount, should the quantity be "reverse calculated" or not? In this case, use RowChange/ColumnChange evenmts to calculate values rather the expressions. There is one more disadvantage: You will need to bind 15 rows of the table at a time. I have been playing with it some time but not developped efficient way.
2. Create some calculator class, which can be bound with textboxes (or whatever control you want) and directly operate on datasource you want. I think, this method is much better, because you can validate data in the fly (esp. when input is bound to textbox), and calculating logic may be much more complex when you'll need it.
Smile | :)
GeneralRe: TextBox calculations on the fly. Pin
Heath Stewart3-May-04 1:52
protectorHeath Stewart3-May-04 1:52 
GeneralRe: TextBox calculations on the fly. Pin
..Hubert..4-May-04 7:51
..Hubert..4-May-04 7:51 
GeneralRe: TextBox calculations on the fly. Pin
Heath Stewart4-May-04 8:04
protectorHeath Stewart4-May-04 8:04 
GeneralArray and form Pin
brugi821-May-04 23:20
brugi821-May-04 23:20 
GeneralRe: Array and form Pin
leppie2-May-04 0:54
leppie2-May-04 0:54 
GeneralRe: Array and form Pin
Dave Kreskowiak2-May-04 4:36
mveDave Kreskowiak2-May-04 4:36 
GeneralRe: Array and form Pin
thomasa2-May-04 22:23
thomasa2-May-04 22:23 
GeneralRe: Array and form Pin
brugi823-May-04 1:10
brugi823-May-04 1:10 
GeneralHiding Toolbar Pin
Mazdak1-May-04 21:10
Mazdak1-May-04 21:10 
GeneralRe: Hiding Toolbar Pin
Stefan Troschuetz1-May-04 21:46
Stefan Troschuetz1-May-04 21:46 
GeneralRe: Hiding Toolbar Pin
Mazdak1-May-04 22:09
Mazdak1-May-04 22:09 
GeneralRe: Hiding Toolbar Pin
Heath Stewart2-May-04 6:39
protectorHeath Stewart2-May-04 6:39 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 8:31
Mazdak2-May-04 8:31 
GeneralRe: Hiding Toolbar Pin
Heath Stewart2-May-04 8:51
protectorHeath Stewart2-May-04 8:51 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 8:56
Mazdak2-May-04 8:56 
GeneralRe: Hiding Toolbar Pin
Heath Stewart2-May-04 8:59
protectorHeath Stewart2-May-04 8:59 
GeneralRe: Hiding Toolbar Pin
Mazdak2-May-04 9:47
Mazdak2-May-04 9:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.