By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Is this a Bug or something I oversee?

P: n/a
Cor
Hi newsgroup

I was answering something to Dotnet Shadow when I remembered me that I had
send a posible Bug to Herfried and Ken Tuckers private newsgroup
"microsoft.public.dotnet.languages.vb.controls " on 25 november about almost
the same question Robert was asking. I never did get any answer on it.

That was with a button, from which I thought that it was after enabling
still firing.

Therefore before giving Robert an answer I tried it again but then with the
textbox and I thought that it was working fine.

But because I found the answer with textbox.readonly a very nice answer
yesterday in this newsgroup I did test that also.
\\\
Here is the code that left will somebody try it?
' needs one texbox, one button and one label on a form
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.TextBox1.ReadOnly = True
Me.Button1.Text = "Locked"
Me.TextBox1.Focus()
For y As Integer = 1 To 100
Threading.Thread.Sleep(50)
Me.Refresh()
Next
Me.TextBox1.ReadOnly = False
Me.Label1.Text = Me.TextBox1.Text
Me.Button1.Text = "Unlocked"
End Sub
///

If the textbox is disabled you can type some text (not repeating), and when
the sub is ended it comes in the textbox but not on the label.

If what I think that I see is true, I think it is not good to give the
advice to use the textbox readonly property

Please comments?

Cor
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Cor" <no*@non.com> schrieb
\\\
Here is the code that left will somebody try it?
' needs one texbox, one button and one label on a form
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Me.TextBox1.ReadOnly = True
Me.Button1.Text = "Locked"
Me.TextBox1.Focus()
For y As Integer = 1 To 100
Threading.Thread.Sleep(50)
Me.Refresh()
Next
Me.TextBox1.ReadOnly = False
Me.Label1.Text = Me.TextBox1.Text
Me.Button1.Text = "Unlocked"
End Sub
///

If the textbox is disabled you can type some text (not repeating),
and when the sub is ended it comes in the textbox but not on the
label.

If what I think that I see is true, I think it is not good to give
the advice to use the textbox readonly property

Please comments?


I tested it again now, but, sorry, I don't see the point. The app behaves
like expected (like I expected it *g*). The text I type during Sub
Button1_Click is put in the message queue. After the loop, the content of
the textbox is copied to the label. As the entered chars are still in the
queue, it is still the text when the sub has been started. After the message
(button click) has been processed, the message queue is processed and the
chars are entered in the textbox.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
"Cor" <no*@non.com> schrieb
Hi newsgroup
Hi Cor,

I tried to figure out what's the core statement/question (or Cor statement?
*g*) with your message. Unfortunately I couldn't. I also see your other
message pointing me to this message.
I was answering something to Dotnet Shadow when I remembered me that I had


After I read it the first time, I thought you were referring to the
"Shadow(s)" keyword, so I didn't understand. :-)

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
Cor
Hi Armin,

From your messages in the other thread I understood that you did supose this
as espected, with a *g*.

But when you change the Me.textbox1.readonly = true to
me.textbox1.enabled is false
and then the other one also, you should get another behaviour.

And I thought, that should be if your comment is true be the same.

Cor
Nov 20 '05 #4

P: n/a
"Cor" <no*@non.com> schrieb
From your messages in the other thread I understood that you did
supose this as espected, with a *g*.

But when you change the Me.textbox1.readonly = true to
me.textbox1.enabled is false
and then the other one also, you should get another behaviour.

And I thought, that should be if your comment is true be the same.


The difference is that enabled = false sets the focus to another control.
That's why the keys are sent to the other control (to the button in my
case). The keys *are* sent to the textbox if readonly = true because the
focus is still on the textbox.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5

P: n/a
Cor
Hi Armin,

So the solution for this *g* can be to create a very small button or
something with focus?

What do you think?

Cor
Nov 20 '05 #6

P: n/a
"Cor" <no*@non.com> schrieb

So the solution for this *g* can be to create a very small button
or something with focus?

What do you think?


Hmm.... I expect that the control that has the focus before the loop will
have the focus after it. Or I'd better say, any control but this "small
button" should have the focus, but then it will also receive the keyboard
input.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7

P: n/a
Cor
> Hmm.... I expect that the control that has the focus before the loop will
have the focus after it. Or I'd better say, any control but this "small
button" should have the focus, but then it will also receive the keyboard
input.


But if it is than a fake it does not matter.
(Button without events)

Cor
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.