|
hi,
Do one thing...........
In properties window of textbox select events tab (shown like lighting)...
there is keypress event.............just doble click on it..........it will goes to code the function...........
Nisar Inamdar.............
Always for U..........
|
|
|
|
|
There are two ways you can create the event handler routines for the key press event.
Firstly in your initialisation routine type the following: (where "textBox1_KeyPress" will become the event handler routine)
textBox1.KeyPress += new KeyPressEventHandler(textBox1_KeyPress);
(As you are using Visual studio as soon as you type the "+=" part Visual Studio should prompt you with an auto complete option - press tab twice and it will create both the above line and the event handler routine)
2nd way is through the form designer. Click on the textbox and go to the textbox properties window. Click on the events button (the little lightning icon) then simply double click inside the KeyPress item in the list. This will create the routine for you and should take you to the code.
|
|
|
|
|
yep i like the second one, easy and gud... thanks dudes
Becoming Programmer...
|
|
|
|
|
HI:
i want to develop an application in which when i write text in textbox in english it converts into unicode and displays text in urdu.
anybody have idea about it
Thanx in advance
Farhan Ali
|
|
|
|
|
|
|
Is it me or is the documentation on setting up a secure tcp channel in remoting particularly opaque?
Please, can someone explain to me in words (preferably) of one syllable how to use the .Net remoting 2.0 tcp security model to do the following:
Cause authentication and encryption to be required on calls to a singleton remoted object.
The scenario is: I have a huge LED display board in a call centtre. The server it is connected to (by RS232 (quaint)) exposes it's interface as a remote object. A web site on the intranet remotes in to set the text on the display. The web site is Windows authenticated, but obviously anyone with the URL of the display server could remote in and put rude messages up in the call centre.
So, how to secure?
I've got this far
IDictionary properties = new Hashtable();
properties.Add("port", 12000);
properties.Add("secure", true);
properties.Add("impersonate", true);
IChannel channel = new TcpChannel(properties, null, null);
ChannelServices.RegisterChannel(channel, true);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(LaserDisplayBoardDriver),
"LDB",
WellKnownObjectMode.Singleton);
but I don't know how to consume this in the client, nor how to pass credentials.
Please help!
|
|
|
|
|
|
I am working on a small game , and i have a problem --
when the user win a message box appear asking him if he want to play again if he answered -yes- the form must be shown again as it was in the beginning of the game , and i do not know how to reload the form
thanks ,
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
Hi,
AFAIK you can load a form only once. But you can show and hide it many times
using either Show()/Hide() methods or setting Visible property true/false.
Apart from that, you could create a new instance of your form, which would give you its
initial state automatically (wanted or not).
|
|
|
|
|
thank you Luc Pattyn for your replay
I do an instance in a method and hide the current form ,and it works , but i think when i hide the current form to call the new instance that i make an over load in memory because the current form is still exists .
what do you think , How can i close the current form to cal its new instance ??
thanks again
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
why would you do that ?
it is one or the other:
1. create a single instance, and now loop {initialize variables, show, hide} until app exits
OR
2. loop {create an instance, show, close } until app exits
it does not make sense to create a new instance, while a previous one is still around
(hidden instead of closed).
|
|
|
|
|
Sorry Luc Patty , I do not understand you , ok lets go slowly
first :
the user choose new game > The PlagGame Form Will Be shown(By Calling The Create Method witch create an instance from PlayGame Form).
Second :
the user Win Or Lose a Message Box Appear And Asking Him If He Want Play again ??-the PlayGame Form Still Exist -
third:
in this step i need to ReShow the PlayGame Form to looks like an other new game if i hide the current PlayGame form i need than to call it again with out create another instance How can I ????
sorry I know that my question may be bored
thanks any way
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
Adding to my previous reply:
you may find it difficult to organize the looping in a single form; the natural solution
is to have two form classes, the main one organizing the looping (and maybe showing highest
scores, or whatever), the second one representing a single game.
So now the app would:
create and show a main form,
then loop over the following steps {
create a game form,
show it (maybe as a dialog) (and maybe you want to temporarily hide the main form)
let the game run,
when the game is done, make mainform visible again (if hidden), and close the game form
}
As I said before you could reuse the game form (by hiding, not closing it), but I
see no real advantage here, since now you must reinitialize the game form explicitly
for consecutive runs of the game.
|
|
|
|
|
of course you are Right ,and i did what you said when the user finish close the game form an return to the main form .
but i do not want to return to the main form again after finishing the game , i want the game form to reshow again as if it reloaded ,that is the problem .
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
The main form can organize that without being visible.
And as I said before, the game form can either be reused or be replaced by a new
instance (that would cause some flickering I guess).
|
|
|
|
|
Hi Mona,
you do one thing.....
Create one function which loads the form and then recall it .
example---------
MessageBox.Show("Are you want to play Again??????","Play Game",MessageBoxButtons.YesNo)==DialogResult.Yes)
{
///call the functio here...........
}
Nisar Inamdar
|
|
|
|
|
thank you Nisar Inamdar for your replay .
i do a method witch create an instant from the form and call it and hide the current form ,and it works .
but i have a question when i hide the current form every time the user win or lose the form still exists ,do you think that is over load in memory , and bad performance , i do not know i am asking
thanks again for your Useful Replay
Mona ,
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
I believe you can do a Form.Close() and then a Form.Dispose() in order to clean up the memory, instead of having the form stick around w/ Form.Hide.
|
|
|
|
|
Hello,
As the Close method allready calls Dispose, the additional Dispose call is not usefull and could also lead to an Exception!If the GC is faster then you
All the best,
Martin
|
|
|
|
|
I wanna do something like
Dictionary<string, object=""> params = new Dictionary<string, object="">
string[] a = new string[10];
params.Add("Array",a);
CallWcfService(a);
It throws an error saying
Type 'System.String[]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
Any help?
- Projjal
|
|
|
|
|
Erhm, using .NET Framework 2.0 using a dictionary would look something like this :
<br />
Dictionary<string, string> myDict = new Dictionary<string, string>();<br />
myDict.Add("stringvalue", "stringvalue");<br />
|
|
|
|
|
I am reading strong name signing in .NET world. say I am developing dlls to distribute,
example1.dll I will get a strongname file using sn -k example1.snk, test example1.dll using its public key and sign it with private key when ready to release.
When I work on the second dll, example2.dll I will do the same thing - example2.snk, am I right that the private keys are different? Does it make sense in te same comapny,the private key should be kept the same(and secret) and the public keys change? Is there anyway to retrieve a private key from a .snk file?
Thanks
|
|
|
|
|
The strong name key used only really matters in a few instances. It can be used to set up a new category for security settings, so that assemblies from a given manufacturer can be given higher than normal privileges (e.g. to allow access to local files by name if running from a network drive). It must also be used in building Publisher Policy assemblies used to force clients of old versions of an assembly to a newer version of the assembly - this is to ensure that only the original publisher can do this.
The strong naming keys are a pair - one public key corresponds to one private key and no other. In general, one organization should use the same strong naming key for all applications. In some cases, you may want to reserve the private key for a final release step, to protect it from being accidentally used or used maliciously. In this case, use sn -p to extract the public key and save it to a separate file. Distribute the public key to your developers and secure the original key file which contains both keys. Developers then use the /delaysign option so that the compiler leaves space for the signature in the file, and records the full name of the assembly. They will need to use sn -Vr to suppress verification for that assembly or public key token, otherwise the Framework will refuse to load the assembly. You then need to use sn -R to re-sign the assembly, using the private key, for distribution.
However, BY FAR the simplest approach is NOT to use strong naming and simply make private copies of shared assemblies in each application which uses them. The GAC is overused, in my opinion - only those assemblies which really must be shared should go in the GAC. If you're not intending to place the assembly in the GAC you should not strong-name the assembly, because the Framework uses different location rules for strong-named versus private assemblies.
|
|
|
|
|
In one connection i want to take two sqlcommands cmd1 and cmd2 is it possible ??????????????
srinivas
|
|
|
|