|
Hi,
you could do this by binding the textboxes KeyUp-Event. The first argument passed to the eventhandler is the triggering object (in this case the textbox where the user has written in). the code for the eventhandler could look like:
TextBox mytxtbox = (TextBox) sender;
if (mytxtbox.Text.Length == 3)
theNextTextBox.Focus();
if you need further assistance feel free to ask
|
|
|
|
|
hi Chanti,
You can do this by more than one way. The most easy way that I could think of right now is to set the maximum lenght property of the three text boxes (lets say firstTextBox, secondTextBox, thirdTextBox) to 3-3-4 simultanuously.
After doing so the program want allow u to type more than 3 digits in the first text box but wont take u to the next one. So u have to fire an event of that text box. The event that u should fire is the TextChanged event and write inside this method the following code:
if (firstTextBox.Text.Length == 3)
{
secondTextBox.Focus();
}
This will take the focus and the next character to the secondTextBox. And u can do this for the other textboxes too.
If you need any help in any other issue, don't be shy to add me at the following MSN address: jamilaboukhalil@hotmail.com or you can just send a mail.
Jamil Abou khalil
|
|
|
|
|
yes this is right solution
the previous one does fail when we keep the key pressed
|
|
|
|
|
then you should use the keypressed value
if there already are 3 characters in the textbox set e.Handled to true and set focus to the next textbox otherwise allow it to write the value
|
|
|
|
|
Yea right, that's the negative side about the keydown/keyup/keypressed events.u don't know which key is pressed.
Anyway hope that i did benifit u.
Feel free to contact me at my MSN address jamilaboukhalil@hotmail.com.
Take care
|
|
|
|
|
Hi,
I am using a simple popup application in which I popup a window and the window will write the value into the parent window text box.
child.aspx
function Fillvalue()
{
var txtDefault = document.getElementById('txtChild');
window.opener.document.form1.txtDefault.value = txtDefault.value;
window.close();
}
default.aspx
function OpenPopup(parentID)
{
var winHeight = 600;
var winWidth = 830;
var url = 'frmChild.aspx?';
options = 'menubar=0,resizable=1,status=0,scrollbars=1,height=' + winHeight + ',width= ' + winWidth +
',left=' + ((screen.width-winWidth)/2) + ',top=' + ((screen.height-winHeight)/2);
window.open( url, '', options );
}
This is working fine and returning me the desired value. which I entered in the child(popup) window.
but, when I am using
window.opener.document.form1.txtDefault.value = txtDefault.value;
in my other application the above is not working. I am very much confussed, what might be wrong, any solution please....
Ram
|
|
|
|
|
Hi all,
I need to know how to authenticate a user before sending a mail using a
C# application. The authentication should be done after sending mail order is initiated. or in other case if possible i need to know how to get the user name and password from the session that the user is signed in to.
The source code i use is this:
private void sendMailButton_Click(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new
MailMessage(toTextBox.Text, fromTextBox.Text, subjectTextBox.Text,
bodyTextBox.Text);
SmtpClient obj = new SmtpClient(SMTPTextBox.Text);
obj.Send(mailMessage);
MessageBox.Show("Message Sent");
}
catch (Exception ex)
{
MessageBox.Show("message not sent");
}
}
I need to add the authentication part. This is working but with no
authentication for the user or the mail sender address. I am using a
local SMTP server.
Thanks,
Jamil abou khalil
|
|
|
|
|
For sending a mail with authentication..you could try:
try
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(toTextBox.Text);
message.Subject = subjectTextBox.Text;
message.From = new System.Net.Mail.MailAddress(fromTextBox.Text);
message.Body = bodyTextBox.Text;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(SMTPTextBox.Text);
smtp.Credentials = new System.Net.NetworkCredential("username", "password");
smtp.Send(message);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Replace the "username" and "password" with the actual username and password.
Hope that helps,
Ashish
Time flies like an arrow;
Fruit flies like a banana.
Ashish Derhgawen - http://ashishrd.blogspot.com
|
|
|
|
|
HI,
Thanks for your reply but the funny thing is that i posted this article in more than one discussion board and all the replys and answers that i got were the same as your answer. The funny in that is that it never worked. Even if i put the user name and password of the sender and put another sender name it never worked. It is sending the mail all the time.
If there is any other way please do reply and tell me how to.
Thnaks in advance,
Jamil Abou Khalil
|
|
|
|
|
I did a quick google search..I couldn't find any other way..but perhaps you'd find something at: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=717&SiteID=1
I'm still searching for other methods...I'll let you know if I find any.
- Ashish
Time flies like an arrow;
Fruit flies like a banana.
Ashish Derhgawen - http://ashishrd.blogspot.com
|
|
|
|
|
Hi,
I'd like to know how I could launch an URL (preferably in the default browser) with a specific referer, by clicking a a button (or any control really). I've seen various tutorials about making your own web browser, where they show you how this can be done (through the navigate method of the WebBrowser control I believe) but I haven't come across any tutorial that shows how one could achieve that by opening a process (IE, Firefox, etc).
Any help, would be greatly appreciated. Thank you.
|
|
|
|
|
The following will open the specified URL in your default browser:
Process.Start("http://www.codeproject.com");
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Okay thanks, but is there a way to open it with a specific referer. As in, launching "http://www.codeproject.com" in the default browser with the referer "http://www.google.com" for example?
|
|
|
|
|
Sorry man but I don't know a way, which doesn't mean there isn't one
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hii all,
I am doing an application which lists the installed softwares in local system as well as remote systems. I can get the installed softwres by reading the registry key value "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall".
But when I tried to read the registry of remote systems using the method "OpenRemoteBaseKey" I am getting an access restriction exception. How can I solve this or is there any alternative method to do this.. Plz help
Thanks in advance
Ranjith Stephen
|
|
|
|
|
hi Ranjith!
u should have administrator rights for accessing remote registry service on a remote machine ..
by d way why dont u use WMI for getting all d installed applications on local or remote machine..
try using 'Win32_Product' class for getting the list of installed application..
but for this also u should have Administrator Previleges .. on remote machines..
abhinav
|
|
|
|
|
Hii Abhinav
Thank you very much for your reply. Actually I am not familiar with WMI. Anyway I will find it out.
We can add registry permission using regsvr32.exe.
thanks
Ranjith Stephen
|
|
|
|
|
Hi,
We are developing a software, it has two versions. Trial version and full version. Our
main concern is ensuring customers cannot stick the full version on a file sharing
network or give it away to friends.
If any user buy the full version, he should not be able to give it to another person (It should not work in other machines).
What is the best way to achieve this goal?
Thanks!!
jayasshc
|
|
|
|
|
See the post 6 below this one - how to protect application
Regards
Malc
*********************************************
|
|
|
|
|
I am working in VS2003 and I created a project which is properly installing, however I need to add 2 more files, but I need them to go directly to the c:\
Currently the setup package is placing those files inside the application folder.
Is this possible?
Thanks
|
|
|
|
|
hi.
i wanna execute a PHP file on a remote server in C# and retreive some data from that PHP file!
how can i do this?
thanks
asamay
-- modified at 21:08 Monday 9th October, 2006
|
|
|
|
|
Hi,
i haven't done anything similiar before but i'm sure you can do this with the System.Net.WebClient class. It provides methods like DownloadFile and ReadFile if i remember right. Executing a PHP file isn't anything else than doing a webrequest.
You will never see the php script code on a page (unless php does not work properly) - those scripts will be preprocessed. that means it generates an output which will be send to the one who did the request.
Hence you just have to "behave" like an internet browser and ask for the files.
Since i don't know how to use the webclient class i would suggest you to use google and learn something about it - i'm sure it's the solution for your problem
Good luck,
mik
|
|
|
|
|
thank you mik,
i will look at webclient class in google!!
asamay
|
|
|
|
|
Hi.
I'm looking to create an application which is able to dynamically update the display name depending on certain conditions.
I have looked around and there's alot of stuff on creating a new client but not much on interacting with MSN directly
Can anyone point me in the right direction?
Thanks
|
|
|
|
|
Two Questions:
1.) Does the image that you set the wallpaper to have to be a bitmap? I know that in the Display Properties you can select a number of different image types, but does Windows convert them to bitmaps before it sets the wallpaper? I ask because if I use a bitmap as the wallpaper I can change it fine, if I use a jpeg it doesn't work (just sets it to a gray background).
2.) Is there a more .NET'ish was to set the desktop wallpaper? I'm currently using P/Invoke with SystemParametersInfo to change it.
I guess that's three questions...Any help on this would be appreciated.
Thanks
- Aaron
|
|
|
|