|
Register for the KeyDown-Event of your textbox. Within the handler check if the KeyCode equals Enter and call your OK-method.
|
|
|
|
|
What about using a KeyPreviewDown event handler for the text box, then you can use the same code you use in your button Click event handler
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
You can do it like this.
textBox.PreviewKeyDown += new KeyEventHandler(textBox_PreviewKeyDown);
private void textBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return && Keyboard.Modifiers == ModifierKeys.None)
{
DoSameThingAsOKButton();
e.Handled = true;
return;
}
}
Hope this helps,
Bart
|
|
|
|
|
I think you have replied to the wrong persona
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
You don't need any code for this, just:
- make sure TextBox.AcceptsReturn is false
- have an OK button with DialogResult not equal to None
- set your form's AcceptButton to that OK button.
|
|
|
|
|
Hi all.
I'm gonna send a file via local network for a specific IP !
How can I do it with C# ?
Could you guide me ?
Thanks a lot.
|
|
|
|
|
|
Thanks.
Is there a difference between wireless and normal networks ?
|
|
|
|
|
No... if you have the ISO/OSI stack in mind, TCP is a higher-level protocol than the protocol that will differ between wireless and "normal" networks.
|
|
|
|
|
1.when PDf files are opened on Internet Explorer, where did these files get saved in temporary internet files folder? The PDF files of small size (eg.,<600kb) are obtained in Temporary Internet files but If these files are of large size(eg.,>1MB) where did they get saved?
2.when did FileDownloadEvent gets fired? I had got this link:
http://msdn.microsoft.com/en-us/library/aa752085(VS.85).aspx
Are there any example which shows this?
3. Are there any event that gets fired after a PDF file got obtained in Temporary Internet files folder?
4. What was the difference between URL(parameter obtained through DocumentComplete event) and webbrowser.LocationURL?
|
|
|
|
|
Hi, Experts
In my c#.net 3.5 windows application i have a .hlp file.
how can i open that .HLP file through .net
Please help me.
Thanks In Advance
--Naren
|
|
|
|
|
Help.ShowHelp(this,path of file);
using this i got
|
|
|
|
|
Hi My friends.
I have string pattern from ftp side which includes both files and folders.
can any body tells how to detect folders on that string pattern.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
I dont get your question, do you want to connect to remote server and access the files?
|
|
|
|
|
based on the [list *.*] output some server respond stream is different from others.
as i am connecting to 2 different ftp servers and i am getting different string pattern
from both ftp servers from LIST *.* output.
while one contains [FileType+Permission Size Date/Time file/foderName] and other contains [DateTime Size forDirectoryonly file/FolderName].
so now i want to get the foldername from both strings.
i am asking for a command in ftp not the way to get directory or file name from string pattern.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
|
Yes, you can.
You're welcome!
|
|
|
|
|
Only if you add a reference to these projects.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
Can a local system (not ststic IP) with internet connection can register using RemotingConfiguration.RegisterWellKnownServiceType, and will its URL accessible from any other system with internet connection from any network?
if not.. how can i register a local system for remotting, where any system from any network can access it.
Thankyou
YPKI
|
|
|
|
|
NHibernate - where clause include result from a STORED PROC?
I have this stored procedure "spIsAuthorized" with an OUT param "IsAuthorized" of type CHAR (Y=yes authorized and N=not authorized)
Now my question is, without access control checking I normally load the objects using ICriteria/or/IQuery
<br />
IQuery oQuery.SetMaxResults(nMaxResults);<br />
IList lstResult = oQuery.List();<br />
...<br />
OR<br />
...<br />
ICriteria oCriteria.SetMaxResults(nMaxResults);<br />
IList lstResult = oCriteria.List();<br />
Now how do I filter (add to oCriteria or where-clause of oQuery) so that only those authorized is returned? Basically I want to do something like this:
<br />
oCriteria.Add( Expression.Eq("spIsAuthorized", "UserId=123,ActionId=2", "Y") )<br />
* spIsAuthorized=stored proc
* UserId and ActionId are input param to stored proc
* Y = output param of stored proc, "IsAuthorized".
Thanks!
dev
|
|
|
|
|
Hi,
I would like to how do you keep user info (authenticated object) into program? are you create a centralize controller for keeping that in static method?
|
|
|
|
|
calendarw wrote: are you create a centralize controller for keeping that in static method?
yes
usually i create static class to hold data that will be accessed in other objects, like "session" in webserver
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Have you looked at the Settings of the Project Properties? This is usually where you would store user configuration settings.
|
|
|
|
|
Hi,
I have the following C# code:
Process notepad = new Process();
notepad.StartInfo.FileName = "notepad.exe";
notepad.Start();
Now the notepad process is started.
How do I execute a valid keyboard shortcut in it for e.g. "Ctrl+N", "Ctrl+O" etc.
I did not find any property to which I could assign a shortcut key, that would be executed after I start my Process.
Thanks in advance.
|
|
|
|
|
Shortcuts aren't executed, just as keypresses aren't executed. You want to SendKeys to the application. There are some examples on this site that show how to send keystrokes to another application
I are troll
|
|
|
|