473,383 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Is this a Bug or something I oversee?

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
7 863
"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
"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
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
"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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Martin Lucas-Smith | last post by:
I am trying to take a string and split it into a filename and a number where the number is what follows the *last* instance of a comma in that string. Split and explode won't work because if the...
8
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
5
by: Jason | last post by:
Hello. I am trying to learn how operator overloading works so I wrote a simple class to help me practice. I understand the basic opertoar overload like + - / *, but when I try to overload more...
44
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a...
5
by: Daniel Vukadinovic | last post by:
Can anyone explain me these things in C++? 1.What is :: used for like in the next case: if(.... { ... ::one;
7
by: cj | last post by:
I'm sure it's simple but it's new to me I can dim x as new something which defines x as a new instance of something in one statement. I can also dim x as something then later make x = new...
4
by: D.Hering | last post by:
When I see something like this prototype: SOMETHING int func( int x ); what is SOMETHING doing there? thanks very much, -Dieter
2
by: Andrew Backer | last post by:
I hope someone out there can help me with this, because I am stuck. My problem is that I have an instance of a generic class, but I don't know ahead of time what the type parameter used was. In...
5
by: Ayebaleet | last post by:
Hello everybody, I understand the basics of Java, but not such features as are helpful in an applet namely Listeners. I wanted to create a feature like this: A program would be displayed in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.