|
As the title is saying that shortcuts aint working(ie. Ctrl+A) in TextBox when MultiLine is true. I have tried to use my own code but i'm still hearing system exception beep when i press Ctrl + A.
private void ABCText_TXT_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyData == Keys.A)
((TextBox)sender).SelectAll();
}
any idea ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I just created a text box then enabled multiline and tested. Control + A works fine.
You may need to give some more information about your problem. Esp in regards to any properties you set to the text box
|
|
|
|
|
this.headerText_TXT.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.headerText_TXT.BackColor = System.Drawing.Color.White;
this.headerText_TXT.ForeColor = System.Drawing.Color.DimGray;
this.headerText_TXT.Location = new System.Drawing.Point(7, 24);
this.headerText_TXT.Multiline = true;
this.headerText_TXT.Name = "headerText_TXT";
this.headerText_TXT.Size = new System.Drawing.Size(306, 53);
this.headerText_TXT.TabIndex = 31;
this.headerText_TXT.WordWrap = false;
this.headerText_TXT.TextChanged += new System.EventHandler(this.headerText_TXT_TextChanged);
thats all that TB have
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
ok. dont see no probs there. have you tried a new project with just a textbox? did you say it works when multiline is false?
|
|
|
|
|
musefan wrote: did you say it works when multiline is false?
yes, it works if i set it False
perhaps its a bug in vista as usual
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
well that def is a strange one.
I using XP so cant test on vista. Are you using latest .Net Framework (3.5)?
Seems on some forums issues where found with earlier versions but i cant say i have read much detailed info on the matter.
|
|
|
|
|
It works fine for me on both Vista and XP. I am using Framework 2.0.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
damn, i just have installed
Microsoft .NET Compact Framework 1.0 SP3 Developer
Microsoft .NET Compact Framework 2.0
Last System Update : 1-05-08
never thought about it as VS installs Framework as well(at least V.2.0 not compact)
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Cant see line like this.headerText_TXT.KeyDown += .
Have you missed it while copying it here or in the code as well?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
i removed that
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi All
Is there any difference in the following three strings. Is any one of them more preferred over the other two.
lblScore.Text = correctNums.ToString() + "/" + numberOfTurns.ToString();
lblScore.Text = String.Format("{0}/{1}", correctNums, numberOfTurns);
StringBuilder str = new StringBuilder();
str.AppendFormat("{0}/{1}", correctNums, numberOfTurns);
|
|
|
|
|
Read this[^] article. Might help you.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
Thanx D@nish that was a great article.
|
|
|
|
|
The Concat method is slightly faster than the others. The Format method and your use of StringBuilder is virtually the same, as the Format method uses a StringBuilder and the AppendFormat method.
When you send the values to the Format and AppendFormat methods, they will be boxed. That means that a new object is created on the heap and the integers are stored in this object. Using the Concat method avoids the boxing.
If you want to use a StringBuilder, this is a better approach:
lblScore.Text = new StringBuilder().Append(correctNums).Append('/').Append(numberOfTurns).ToString();
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Number 2 is the right way, number 1 is the wrong way and number 3 does something entirely different to 1 & 2 (It does not assign a variable to lblScore). If it did assign str.ToString() to lblScore then it would be mostly the same as 2, but with the worthless overhead of creating a StringBuilder. If however you were appending a greater number of strings to the output then 3 would be the better way to approach the problem.
|
|
|
|
|
J4amieC wrote: Number 2 is the right way, number 1 is the wrong way
I wouldn't say right or wrong, it's more of which is better for the given circumstance
only two letters away from being an asset
|
|
|
|
|
Compiler changing concatenation with + to a stringbuilder asside, there is never a good reason to concatenate strings using +. Ever.
|
|
|
|
|
I would disagree, its a matter of preference. I see nothing wrong with something like "Some string: " + x, depending on the circumstance it is being used in.
As Guffa points out there may be some boxing that is occurring with StringBuilder and Format which could be avoided.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: I see nothing wrong with something like "Some string: " + x
I see nothing right with it, and no reason to use it over either of:
String.Format("Some string: {0}",x) or String.Concat("Some string: ",x)
|
|
|
|
|
You realise that using the + operator and using the String.Concat method produces identical code?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
That is a COMPLETELY INVALID statement...I can't tell you how wrong that is. StringBuilder and String.Format are only useful and more performant in certain scenarios, not all. If you are joining thousands of string parts, StringBuilder will definitely be more efficient. If you are "formatting" a string, and you need localization support and the like, String.Format is your friend. However, for smaller concatenations where you know the number of parts involved, nothing beats the performance of a basic concat. Research it.
|
|
|
|
|
j4amieC you are write I did not write the full code in the third case, but yes the StringBuilder does assign the text to the lblScore.
Can you tell me why concatenating strings is not a good idea in this case. Does it leave string objects in memory? Or is there any other reason?
|
|
|
|
|
humayunlalzad wrote: Can you tell me why concatenating strings is not a good idea in this case.
Concatenate 10,000 strings using + and time it.
Now concatenate the same 10,000 strings using a stringbuilder.
Compare the times.
|
|
|
|
|
J4amieC wrote: Concatenate 10,000 strings using + and time it.
Now concatenate the same 10,000 strings using a stringbuilder.
Compare the times.
Here you go:
Concatenating using + operator 10000 times: 3.50 ms.
Concatenating using StringBuilder 10000 times: 5.03 ms.
Concatenating using String.Format 10000 times: 5.97 ms.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
J4amieC wrote: number 1 is the wrong way
Not at all. There is absolutely nothing wrong with using the Concat method to concatenate strings.
J4amieC wrote: If it did assign str.ToString() to lblScore then it would be mostly the same as 2, but with the worthless overhead of creating a StringBuilder.
That is exactly how the String.Format method does it. The method that you say is the "right way" also has the worthless overhead of creating a StringBuilder, so you contradict yourself...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|