|
|
I dont think you find a solution for that. Why do you not interested in Script. You can also try www.visualwebgui.com/ they provide most windows controls to use in your asp.net Application. COOL! ha
-Syed Moshiur Murshed
|
|
|
|
|
hi syed i saw u r msg but i can't get into that site(to see the winform example) is it need to register to enter that site.
ayyp
|
|
|
|
|
and one more thing i need to run this popup or confirm or msgbox only after satisfying two condition (these all are in the same button click event.)when i use script it will run automatically when i click that button,but i dont want that, that box should be displayed only after satisfying condition and i should able to catch the user input that is yes or no like.if u have any code for my need pls send to me.....
ayyp
|
|
|
|
|
Hi all, I want to know that are there any functions like IsDigit and IsSymbol in C# wich let us know that any particular string contains any numbers or puncuation symbols....if they exist then wich r they.....and if they dont then how can we achieve this
Looking forward for help
Regards,
-- modified at 4:37 Saturday 20th May, 2006
|
|
|
|
|
Char.IsDigit, etc, work on a per char basis. I believe there are string based functions, but I have not found them as static methods on string.
You can of course use int.TryParse and double.TryParse to see if the value is an int or a double, respectively.
Christian Graus - Microsoft MVP - C++
-- modified at 4:47 Saturday 20th May, 2006
|
|
|
|
|
Hi,
I dont know about whether there is any in built function for your problem but you can implement this logic in your program by parsing the string character by character and knowing the ASCII codes for them. then compare the ascii codes for each character to be in range of for example numbers, characters or symbols. For this you will have to know the code ranges for numbers, symbols and alphabets in ASCII.
And for inbuilt functions try searching the msdn or msdn online at - http://mdsn.microsoft.com/library
A simple logic would be to convert the string into char[] and then loop in this array to check for Char.IsDigit and Char.IsNumber and Char.IsSymbol, etc....
(I found this after posting the message, so i modified the last post)
Anant Y. Kulkarni
-- modified at 4:45 Saturday 20th May, 2006
|
|
|
|
|
You should NEVER do this. You can use foreach on a string and use Char.IsDigit ( for example ). Using ASCII codes and assuming they are valid is a bad idea on a number of levels.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I havent got your point. Is there any way that the ASCII codes may be wrong? I think as you press the keys the ASCII codes are stored or sent to the program or what ever. but main point is ASCII is used for representing the characters. Means we used to do this in C. Is there any issues related to using ASCII values for comparisions. If yes, i would be greatfull to know. Also can you please elaborate on the point you replied to my post.
Christian Graus wrote: Using ASCII codes and assuming they are valid is a bad idea on a number of levels.
Number of levels? I hope you got my point.
Thanks
Anant Y. Kulkarni
|
|
|
|
|
Anant Kulkarni wrote: Is there any way that the ASCII codes may be wrong?
Well, for starters, they could be unicode codes. .NET is unicode by default.
Anant Kulkarni wrote: Means we used to do this in C.
Yep, I did it in C from time to time, although mostly I'd use the functions built in there, too.
Anant Kulkarni wrote: Number of levels?
As well as the Unicode issue, it's just a hack when the language provides stuff like Char.IsDigit.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sir i have tried to do this in this way
foreach(char ch in docName.ToCharArray())
{
if(ch.IsDigit())
break;
}
but the problem is that this IsDigit and other r static methods so how can i access them
looking forward for help
Regards,
|
|
|
|
|
As it's a static method, you call it as I demonstrated, using the class name
if (Char.IsDigit(ch))
break;
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thxx Sir, its working
|
|
|
|
|
I'm looking for an example how to write custom text edit control. Not a subclassed textbox but one that is written from the ground up.
|
|
|
|
|
Why do you need one ? I've looked and not found one in the past, but I got around the vagaries of the text box control ( namely that it draws itself out of the paint event ) with a bit of work.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Because I need to have a control over each line/paragraph etc. I want to make something like a custom text editor that outputs to a custom XML formats, depending on the context or the template. For now I cannot find any XML editor that can do what I need and I think the built in TextBox and RichTextBox controls won't do what I want to do.
This is what I want to do and the next thing that is independent of the above is that I want to see how text is handled in text editors and displayed on a form/control.
|
|
|
|
|
I have written one from complete scratch (iow painting every pixel). You can have a look at the source, but beware, the editor control alone is current almost 200kb (7000+ lines) in size. Follow either link below and see the link on the left of the page.
|
|
|
|
|
I know your control, leppie! Thank you! I was overwhelmed I hoped there was something simpler.
I much time have you spent researching, planning and creating it?
Have you ever thought writing an article about it?
|
|
|
|
|
Cristoff wrote: much time have you spent researching, planning and creating it?
It had a few incarnations, so I am not really sure The project has been ongoing now for over 3 years
Cristoff wrote: Have you ever thought writing an article about it?
Dreamt about it, yes alot! Reality, it's so much info to transfer, I am not sure I will be able to ever explain it all to anyone
I have decided to start writing small parts for documentation and post it to my blog. Hopefully one day all the info I have prodived on the blog can be compiled and edited
What I suggest, start off with a string[] for the lines, do a simple DrawString for the text. Find out what metrics you need like line height, and familiarize yourself with that. Then move on to selecting text, you will need some form of MeasureString here. After that make the caret, if needed, some people simply PInvoke this functionality. Finally if editing is required, do that. And then only start messing with colors and such.
Hope this helps a bit, I used a similar path.
|
|
|
|
|
I'd love to see this too... let me know when you publicize it
|
|
|
|
|
Thank you for the tips. How would you use string[]? For example you'll reserve 1000 lines then when 999 are used you'll expand the array by another 1000 lines. We'll this be fast and good enough?
Colors I might not need but who knows What I need to know is exactly what line I'm editing.
|
|
|
|
|
hai guys,i have some problem while implementing msgbox with yes or no buttons using java scripts(or any other script languages.),the problem is,when i use script messagebox it comes into act when the click_event(button) get fired but
my need is:In button click_event i check for two condition, if both conditions are satisfied then the msgbox will show and ask user to enter their value ,that is yes or no.if yes then it should use some the query to update database,else it leave that(nothing should happen).
or is there any other choice to satisfy my need?anyone can help me? very urgent......pls
ayyp
-- modified at 3:51 Saturday 20th May, 2006
|
|
|
|
|
ayyp wrote: if yes then it should use some the query to update database
Your problem is that your message box is a jscript construct on the client, and your database is on the server. So, one way to do this would be to write a page which does your database operation then closes itself, and redirect to that page when the yes button is pressed, so you're running code on the server from the action that takes place on the client.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm sorry, I prefer not to respond to private emails, in general. I wouldn't use a jscript alert, I would use a popup window. In fact, your popup window could just handle a postback event when you click 'yes' without the need for another page. I expected you were creating a popup along the lines of this tutorial:
http://www.htmlcodetutorial.com/linking/linking_famsupp_70.html[^]
Then, if it's an aspx, you can set up your yes button to do your database action on postback.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i have to use the compile class to compile a project but i cant find the way to use it for my purpose
|
|
|
|