|
hi
textBox1.text will give you the text is typed in textBox1
Tamimi - Code
|
|
|
|
|
Hi Tamimi,
That worked! Thank you!
I declared readIn to read what is typed in the textbox like this:
string readIn = this.texBox1.Text;
And attaching it to the eventhandler like this:
readIn += new KeyEventHandler(texBox1_KeyPress);
It gives me the error:
No overload for 'texBox1_KeyPress' matches delegate 'System.Windows.Forms.KeyEventHandler'
What am i doing wrong?
|
|
|
|
|
hi
could you give more details about what you are trying to do ??
if simply you want the text in a textbox the .Text property its enough
and no need to attaching anything.
what exactly you want to do ??
Tamimi - Code
|
|
|
|
|
Hi,
I want to accept only 0, 1, 2 .... 9 as input. In order to do this, i have to attach texbBox1.Text to the keypressed handler.
But i got it fixed now,
Thank you!
|
|
|
|
|
hi
is there any wrong with this:
private void textBox1_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) { int intKeyValue = (int)e.KeyChar; if (((intKeyValue<48 || intKeyValue>57 ) && intKeyValue!=46)) { e.Handled = true; } }
Tamimi - Code
|
|
|
|
|
Hi Tamimi,
There is nothing wrong with that method.
In fact, thats the eventhandler i was trying to attach 'readIn' to.
If a key is pressed 'readIn' will call that eventhandler to check if its a valid one.
Sorry for the confusion Tamimi!
|
|
|
|
|
hi
are you trying to do this:
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
if not feel free to ask again
Tamimi - Code
|
|
|
|
|
Hi Tamimi,
Thats exactly what i meant. But i fixed that half an hour ago
I do have another question...
If i want to get everything between 2 chars, how would i do that?
Example:
[1]
[12]
[123]
How would i get everything between the '[ ]' chars?
Substring wont help, coz the characters inside the [] can be sometimes 1, 3 or more.
Thanks in advance!
|
|
|
|
|
hi
try this:
int intStartIndex = textBox1.Text.IndexOf("[") + 1;
int intEndIndex = textBox1.Text.IndexOf("]") - 1;
string strBetween = textBox1.Text.Substring(intStartIndex,intEndIndex);
but you should be sure that the chars "[" and "]" are exists if not you will get an error index or something like this
Tamimi - Code
|
|
|
|
|
Hi Tamimi,
That worked great!
I thank you for all your help and patience!
Yustme
|
|
|
|
|
you are welcome
Tamimi - Code
|
|
|
|
|
You could also try using the textchanged event of the textbox.
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi,
I have a radio button on my windows form and I want this to be databound to a binding source.
Ok, now it is very easy to set the CHECK State of the radio button to bound to a BIT data type of SQL. But what if I want to add some custom code for the CHECK STATE and the custom code uses the other type of data field from the SQL ? IS is possible ?
Example : I may have a varchar field in SQL which is named "fieldType". Now I want to add the following constraint,
Databound CheckState should be checked if(fieldType == "abc")
otherwise CheckState should be non Checked.
Thanks and regards
|
|
|
|
|
how shutdown the system in c#.net 2005
how to use the initiatesystemshutdown Function in c#.net 2005
|
|
|
|
|
use dllImport atribute to export the API from user32 or kernel32,check out in API viewer
and call the fuction...
eg,
import like this.
[DllImport("kernel32")]
private static extern int InitiateSystemShutdown(,,,);
nishu
|
|
|
|
|
Hi
i want to view a .ini file through c#. can anybody help me to write code for it? i mean i just want to know how to open a .ini file to show it to user.
Regards
sAqIb
|
|
|
|
|
Hi,
There is one programme in codeproject which changes the folder icon,which acctually changes the desktop.ini file ,go through that programme just search in codeproject about it like "changing folder icon".you wil get your answer .enjoy man.
|
|
|
|
|
hi
i don't know if i understand you question, but you can read its content like this:
StreamReader Reader = new StreamReader("a.ini");
String strContent = Reader.ReadToEnd();
Tamimi - Code
|
|
|
|
|
|
thanx everybody.
i got to know how to do that. we can view ini file or any other file like
System.Diagnostics.Process.Start("filename.extension");
hope it will help to other guys here too.
Regards
sAqIb
|
|
|
|
|
I am trying to reverse engineer my application to see the class diagram in visio. The reverse engineering succeeded but the visio file is empty. no diagrams in it.
Can anybody give me some helpful hints on that?
Naji
|
|
|
|
|
It may have created a visio model even though there are no diagrams. Check the model explorer window. You can create your diagrams yourseld by dragging the objects into a page.
--------------------------------------------------
|
|
|
|
|
Dear all,
I have add a listbox with following property on
listbox1.DrawMode=OwnerDrawVariable;
listbox1.HorizontalScrollbar=true;
listbox1.ScrollAlwaysVisible=true;
I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine.
Please help.
|
|
|
|
|
when we have a project of c# consisting of many subprojects.....
subproject B is dependent on subproject A
if we build the subproject A and then build subproject B the subproject A is not again built............whereas if we build subproject B first then subproject A is also built
how c# compiler manages this.......where this information is stored that subproject A has already been built
|
|
|
|
|
Hi,
From what you said i understand that you have several projects in the same solution. To build the entire solution with all the project you can use the Build->Rebuild Solution option. If you want to build all the projects from your solution when you hit the build shortcut key try entering in the Configuration Manager and see if all project are checked for building.
Do your best to be the best
|
|
|
|