|
Hi All,
I am trying to do the following in a web control that I am creating:
I have a username and password textboxes and a login button.
when the user is in the password textbox and if they hit <enter> I want either one of the following two behaviours to happen:
1. do nothing, or
2. automatically fire the login button's clicked postback event
Right now when a user hits <enter> it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!)
This is driving me crazy!
any help would be greatly appreciated!
schoudhr@hotmail.com
|
|
|
|
|
Hi All,
I am trying to do the following in a web control that I am creating:
I have a username and password textboxes and a login button.
when the user is in the password textbox and if they hit "ENTER" I want either one of the following two behaviours to happen:
1. do nothing BUT don't lose focus on the textbox either!, or
2. automatically fire the login button's clicked postback event
(#2 is preferable)
Right now when a user hits "ENTER" it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!)
This is driving me crazy!
any help would be greatly appreciated!
schoudhr@hotmail.com
|
|
|
|
|
If you are talking about a C# Windows application then here's an idea, may give you a place to start.
this.txtPassword.KeyPress +=
new System.Windows.Forms.KeyPressEventHandler(this.txtPassword_KeyPress);
.....
private void Generic_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar == (char)13)
cmdLogin_ButtonClick(this, EventArgs.Empty);
}
|
|
|
|
|
Hello folks!
I need an help with the ascii code.
I must convert a number in the corresponding ascii symbol. Now, from the number 32 to the number 127 it works; but after that, it returns sometime the char '' and sometime a strange symbol which doesnt coincide with the one in the ascii table.
How can i solve?
ps: i write the symbol in a textBox if it can help...
Thank You
Enrico
|
|
|
|
|
ASCII is a 7 bit code, values 128-255 are undefined in it. There are multiple 8 bit extended ascii encodings. The default in .net is apparently different than the one used in what your reference is erroniously calling ascii. YOu'll need to find the ISO number for the encoding you want and set your app to use it instead.
|
|
|
|
|
Can you explain better what u mean for ISO?
I dont know what u are saying...
|
|
|
|
|
Bascially a sequence of bytes only makes sense as a text file in connection with a code page (and encoding).
The code page define which character is at which integer position, while the encoding determines how the number is stored in the byte stream. Rememeber that it was only back in the dark ages people thought 256 charactes where enough, so you need a way to store for example character 7625 (what it is I do not know - that depends on the code page).
You mention you use the ASCII table. As correctly pointed out, the ASCII table only defines characters in the range 0-127. So if you have anything in the 128-255 range, it is certain you are not loading ASCII, but something else.
As the .NET framework obviously use Unicode internally (stored in memory with a UTF-16 encoding) it will need to know how to map the byte stream into characters. This is done with an Encoding (see System.Text.Encoding). So with "ISO" in this case is ment you need to know the encoding so you can specify it to the loader.
You can try using the Default encoding - it is the dafault ANSI encoding on the system so it is what outdated programs would use when processing text. While no modern program should touch ANSI encoding with the water from a remote controled fire hose - except when loading outdated dataformats - it is still commonly used, mainly due to ignorance from developers. The ANSI code page can be changed from the control panel, effectively changing the content of all you text files (start to see why no sane person would use it)?
If ANSI does not load, you can try UTF-8 - and if that won't work either you have to find a way of identifying the code page (to use as a parameter in a call to GetEncoding)... You can try loading the file in Word, it tend to give a fairly good guess.
|
|
|
|
|
Is there a nice way to do this so I could dynamically resize the leftmost column when a V scroll appears to avoid creating an hscroll bar as well?
Theoretically I could use the Graphics class to measure the string height and use that to compute how many lines would fit, but I'd prefer a more natural solution.
|
|
|
|
|
hi all!
i'm new in c# and VS, and i'm working in my university project. i want to do tabbed documents like VS, for that, i use a TabControl but i want that the tabControl has a button in the upper right corner in order to close tabs individually
what shall i do? inherit of tabControl?
create my own control? how?
my witten english isn'y very well, excuse me, i'm spanish
thanks for all!
|
|
|
|
|
just put a control where u want it (like a button or image) then when you click it get the selectedTab and set it visible = false; if the tabControl.tabs.count == 0 then set the visiblie = false to the tabcontrol itself
hope that helps
g00fy
|
|
|
|
|
i had in mind something like it...but i want the button is in the upper rigth corner on the TabControl exactly and not in some tabpage or out of tabControl.
i want that it becomes something like the tabbed documents in visual studio.
thanks g00fyman!
-- modified at 7:50 Wednesday 9th November, 2005
|
|
|
|
|
can't you just make a user control and put the button in the top right then anchor it to top and right. it wouldn't even need to be a user control
regs,
g00fy
|
|
|
|
|
hi to all,
i'm working on a win application with multi document interface (MDI forms).
i have one mdi parent and many mdi child.
in my mdi child i can input some data. i implemented the closing event so if the user hit the cross button in up/right corner i can ask him if he want to save data or cancel the action before exiting the mdi child form. everything is good till now
but if the user the cross button in up/right corner of the parent form, how can i cancel this action, because even if the user say that he wants to cancel the application closes.
does any body have any suggestions
best regards and thanks in advance
fady
|
|
|
|
|
Handle is also in the Closing event in the parent form.
"The Soapbox has been so ..."
|
|
|
|
|
We are embedding the clr into our "legacy" C app, using the techniques discussed in the article here: "Creating a Host to the .NET Common Language Runtime" - http://www.codeproject.com/dotnet/simpleclrhost.asp - and this is working well.
What we would like to find is a very simple example or code snippet for how to make a call from unmanaged c or cpp to a static class method.
Thanks
Rich
|
|
|
|
|
|
|
Hi there ,
I am a electronic and telecommunication student .I am very interested in Tapi and its aplications.
some days ago, i downloaded a tapi3 aplication by devang_binson . I trued to run it but it can not answer and make normal phone call.It can only make a IP call.
I have sked Mr devang_binson but he dose not reply me.
Now , i don't know how to solve it .
If anyone know , please hlp me .
thanks
|
|
|
|
|
I don't know whats the failure of this code:
Image src = Image.FromFile(@"C:\_sc\test.bmp");<br />
<br />
Graphics gr = Graphics.FromImage(src);<br />
gr.DrawImageUnscaled(src, 10, 10, 50, 50);<br />
Bitmap bmp = new Bitmap(50, 50, gr);<br />
pcCuted.Image = bmp;<br />
pcCuted.Invalidate();
I load the test.bmp and redraw it new. So I make a new rectangle (50w,50h) and want to put only this area into the pcCuted Picturebox. Doesn't work.
Any way to do it right?
|
|
|
|
|
You were redrawing back onto the same image as you were reading from
Image src = Image.FromFile(@"C:\_sc\test.bmp");<br />
<br />
Bitmap bmp = new Bitmap(50,50);<br />
Graphics gr = Graphics.FromImage(bmp);<br />
<br />
gr.DrawImageUnscaled(src, 10, 10, 50, 50);<br />
pcCuted.Image = bmp;<br />
pcCuted.Invalidate();
|
|
|
|
|
ok, but this still doesn't work
Image src = Image.FromFile(@"C:\_sc\test.bmp");<br />
<br />
Graphics gr = Graphics.FromImage(src);<br />
gr.DrawImageUnscaled(src, 10, 10, 50, 50);<br />
<br />
Bitmap bmp = new Bitmap(50, 50, gr);<br />
pcCuted.Image = bmp;<br />
pcCuted.Invalidate();
|
|
|
|
|
In english we use "Thankyou for your help, however i am still having difficulties"
I took the time to actually type that code into a new windows project and tested it with an image locally, it did exactly what you asked for - draw a section (10,10,50,50) of the original image into the picture box.
And the best you can give is "still doesnt work"
I'll tell you what, if you tell me WHAT doesnt work, ill even have another try - that is as long as you're a little more polite this time
|
|
|
|
|
Hi,
Either I thank you in advance, problem is solved or finally no solutin was found. I have now a solution, thank for your response and the tip (finally it was the right way).
PS: Every tip is automatically accepted thanks. It's naturally. So why should people post their thanks in an extra thread and wasting space?
|
|
|
|
|
Seraphin wrote: PS: Every tip is automatically accepted thanks. It's naturally. So why should people post their thanks in an extra thread and wasting space?
Because it gives the person who tried to help you a good feeling, and maybe he thinks (i know i do): 'hey that guy is nice, if he asks a question next time i will try to help him again!'
And also it's just good manners...
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Has anyone come across an a paralle processing, distributed computing application in C#? Something on these guidelines.
|
|
|
|