|
Thanks
Meanwhile, was the reply for the earlier thread (disable copy paste) correct?
|
|
|
|
|
Yes, it looked like it to me. I'd have to try it to see if it worked, but that's what I had in mind.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply. But how to draw circle in windows form design? Please guide me.
|
|
|
|
|
The FillEllipse method of the Graphics class. You'd create a control with a textbox and a circle drawn around it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
how to disbale copy paste from and to textbox programatically
|
|
|
|
|
hey
you might be able to "catch" the event of(ctrl + c) and (ctrl + v) and not handle it...
that might do the trick
Hav fun
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
You may be able to do this by catching the keystrokes and rejecting them. I don't think there's a paste event. You would probably need to reset the clipboard after a CTRL-Insert or CTRL-C, b/c it's probably already done.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Like this:
private void textBox1_KeyDown(object sender, KeyEventArgs e) {<br />
if(e.Control && e.KeyCode == Keys.C) {<br />
e.SuppressKeyPress = true;<br />
}<br />
else if(e.Control && e.KeyCode == Keys.V) {<br />
e.SuppressKeyPress = true;<br />
}<br />
}
|
|
|
|
|
private void textBox1_KeyDown(object sender, KeyEventArgs e) {
if(e.Control && e.KeyCode == Keys.C) {
e.SuppressKeyPress = true;
}
else if(e.Control && e.KeyCode == Keys.V) {
e.SuppressKeyPress = true;
}
}
this is good, but i do't want to this code paste in all control.
i want this code type only one time
|
|
|
|
|
prakash_adysoft wrote: i do't want to this code paste in all control.
i want this code type only one time
Do you mean you want this code to execute only once?
If yes then just unbind it using
this.textBox1.KeyDown -= new KeyEventHandler(this.textBox1_KeyDown);
|
|
|
|
|
Aside from the fact he probably shouldn't have just posted up this code as an instant solution (requiring the OP to do nothing for himself), the code only needs to be written once, you can bind one event to multiple controls.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
What if the user copies or pasties using context menu of the textbox?
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Just reinitialize the context menu of the textbox during form load without any items in it.
|
|
|
|
|
I actually found a bug, where you can still get the context menu even when you do that.
If i remember right, to get the context menu to STILL appear, you right-click the text box and hold the button down - move you mouse off of the text box - and then release the button. Then the normal menu appears
My current favourite word is: Bacon!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Thanks for find.
How about handling this in WndProc method then?
|
|
|
|
|
hello,
I have an application that allow me to create many Forms.
When i open many forms i get this error : Error creating windows handle.
After i check for this kind of error, there is many suggestion to minimize the number of controls(handles) because each process do suppport a specified number of controls.
but my forms contain a user controls and more thing that i can't remove.
Do someone have any idea fr this kind of error.
Best regards,
dghdfghdfghdfghdgh
|
|
|
|
|
Hard to make sense of this. How many windows do you have open ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
about 50 windows
dghdfghdfghdfghdgh
|
|
|
|
|
Well, that is just a nightmare for the end user, but I don't see why Windows can't handle it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
error :
Error creating windows handle win32Exception
i think because the number of handle exceed a specifiv limit .
What to do ?
dghdfghdfghdfghdgh
|
|
|
|
|
Hey guys...
in my application all my forms inherit from cmdBaseClass which inherits from Form so essentially i have
myForm : cmdBaseClass : Form
now what i want is so inherit cmdBaseClass from a plain class (not a form) but i dont want to inherit Form because this class is not a form
the only way i can think of doing this is creating a 2nd cmdBaseClass and not inherit Form from that one...
is there a better way to do this?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
There's no two ways around this b/c C# sucks and does not have multiple inheritance. If you want to be able to use a form and non form as if they are the same with respect to a group of functions, you can use an interface, but you still need to define it twice.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanx CG
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
dude,
i made a 2nd cmdBaseClass now (does not inherit Form)...
now my "GlobalMethodsClass" needs to inherit the "Non Form CmdBaseClass" but GlobalMethodsClass is STATIC... it moans that static classes should inherit from objects
i don't get it? isn't cmdBaseClass an object? i thought EVERYTHING in an OOP language is considered an object
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: i made a 2nd cmdBaseClass now (does not inherit Form)...
Two classes with the same name ?
HarveySaayman wrote: now my "GlobalMethodsClass" needs to inherit the "Non Form CmdBaseClass" but GlobalMethodsClass is STATIC... it moans that static classes should inherit from objects
If the class is static, then all your methods need to be static. I don't know if you can derive a static class from another.
Nope - static classes cannot have a base class. That does make sense, b/c what's the point of a class having a base, when no instances of that class can ever exist ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|