« [Ajax] Widegleをみて | Main | A9の凄さ »

17 March 2005

NumericUpDown.Valueに値を入れたときの評価

Windows Form アプリケーションを作成していて、動作としては、
(1)ComboBoxコントロールの選択を変更
(2)(1)に合わせて、NumericUpDownコントロールの値を変更
という、ありがちなGUIを作成したのです。
で、
(A)NumericUpDownコントロールにキーボードから数値を入力
(B)ComboBoxコントロールの選択を変更
(C)NumericUpDownコントロールの値が変わる。
という操作を行うと、(A)で222と入力したとすると、(B)の操作の後、(C)の時点で222は別の値に上書きされるはずなのですが、それがうまくいかない!
なぜか、2回目はうまくいくのに、1回目はうまくいかない。
実際には、(1)で、NumericUpDown.Value=50とかやっているだけなんですね。
でもGUI上で見ると、222がまだ残っているみたいな感じです。
調べてみたら、
[CS:01093] Re: NumericUpDown の使い方


そこで、

numericUpDown1.ResetText(); // 入力テキストをリセット
numericUpDown1.Value = 50;

としたところ、うまく更新されました。

で、できました。

[CS:01088] Re: NumericUpDown の使い方

Valueのチェックが1度は行われないとValueを更新することができない設計みたいで
す。

おーーーい!.NETさん。それでいいのかな?確かにNumericUpDownは上下ボタンを使って、値を更新するものであるから、キーボードからの直接入力なんて面倒みれません、っていいたいところでしょうけど、でもそういうニーズもあるわけで、そのあたりは吸収しておいてもらいたいなぁ。。。

TrackBack

TrackBack URL for this entry:
http://bb.lekumo.jp/t/trackback/517129/31023751

Listed below are links to weblogs that reference NumericUpDown.Valueに値を入れたときの評価:

Comments

I loved as much as you will receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get bought an edginess over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this increase.

I love what you guys are up too. Such clever work and reporting! Keep up the great works guys I've included you guys to blogroll.

Hello, I enjoy reading all of your article post. I like to write a little comment to support you.

Hello i am kavin, its my first time to commenting anywhere, when i read this post i thought i could also create comment due to this sensible post.

I every time used to read post in news papers but now as I am a user of web therefore from now I am using net for articles, thanks to web.

Post a comment

Access Ranking

Powered by Six Apart
Sponsored links