P
Pieter
Hi,
How can I include contraints in VB.NET (Windows Forms, 2.0), using Objects
with Propertys?
I need several property's be recalculated when others change, but not in a
straightforward way: When A is changed, B has to change, but when B changes,
A has to change (or C or ...).
Untill now I added routines in the Set-Property that calculated the other
Property, but I'm loosing the overview, and I would have referred to have
all this rules centrally placed. Also, I'm kind of affraid of endless loops:
A changes B, B changes A, which changed B again etc etc...
Is there a way to do some kind of constraint programming in VB.NET? Or how
should I implement such a thing the best way?
I need constraints like this:
- When the Currency changes, the AmountNewCurrency must be automaticly
changed to AmountOldCurrency * CurrencyRate
but:
When the user changes the in the TextBox the AmountNewCurrency, the
AmountOldCurrency must be changed too (AmountNewCurrency / CurrencyRate).
- Another one: TotalBuyPrice = the total Price we pay for all the Articles
TotalSellPrice = The total Price at which we sell the Articles
Percentage: the percentage we add to the TotalBuyPrice to have a sudden
TotalSellPrice.
-> Is Percentage is changed, TotalSellPrice must be changed (and the
ArticleSellPrice accordingly).
but:
-> When the TotalSellPrice is changed, the percentage has to be
calculated automaticly, and the ArticleSellPrice of each article has to be
changed proportionally
- and many many more...
Any help would be really appreciated,
Thansk a lot in advance,
Pieter
How can I include contraints in VB.NET (Windows Forms, 2.0), using Objects
with Propertys?
I need several property's be recalculated when others change, but not in a
straightforward way: When A is changed, B has to change, but when B changes,
A has to change (or C or ...).
Untill now I added routines in the Set-Property that calculated the other
Property, but I'm loosing the overview, and I would have referred to have
all this rules centrally placed. Also, I'm kind of affraid of endless loops:
A changes B, B changes A, which changed B again etc etc...
Is there a way to do some kind of constraint programming in VB.NET? Or how
should I implement such a thing the best way?
I need constraints like this:
- When the Currency changes, the AmountNewCurrency must be automaticly
changed to AmountOldCurrency * CurrencyRate
but:
When the user changes the in the TextBox the AmountNewCurrency, the
AmountOldCurrency must be changed too (AmountNewCurrency / CurrencyRate).
- Another one: TotalBuyPrice = the total Price we pay for all the Articles
TotalSellPrice = The total Price at which we sell the Articles
Percentage: the percentage we add to the TotalBuyPrice to have a sudden
TotalSellPrice.
-> Is Percentage is changed, TotalSellPrice must be changed (and the
ArticleSellPrice accordingly).
but:
-> When the TotalSellPrice is changed, the percentage has to be
calculated automaticly, and the ArticleSellPrice of each article has to be
changed proportionally
- and many many more...
Any help would be really appreciated,
Thansk a lot in advance,
Pieter