Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralRe: finding Movie duration of a wmv file Pin
sreejith ss nair15-Sep-04 0:37
sreejith ss nair15-Sep-04 0:37 
GeneralRe: finding Movie duration of a wmv file Pin
gupta vaibhav15-Sep-04 3:39
gupta vaibhav15-Sep-04 3:39 
GeneralRe: finding Movie duration of a wmv file Pin
sreejith ss nair15-Sep-04 3:54
sreejith ss nair15-Sep-04 3:54 
GeneralRe: finding Movie duration of a wmv file Pin
gupta vaibhav15-Sep-04 18:18
gupta vaibhav15-Sep-04 18:18 
GeneralRe: finding Movie duration of a wmv file Pin
sreejith ss nair15-Sep-04 22:24
sreejith ss nair15-Sep-04 22:24 
GeneralRe: finding Movie duration of a wmv file Pin
gupta vaibhav15-Sep-04 22:45
gupta vaibhav15-Sep-04 22:45 
GeneralOnly 2 decimal places for data in a textbox Pin
myNameIsRon14-Sep-04 17:07
myNameIsRon14-Sep-04 17:07 
GeneralRe: Only 2 decimal places for data in a textbox Pin
KevinMac14-Sep-04 18:22
KevinMac14-Sep-04 18:22 
There is probably a better way but I have been using the System.Text.Regularexpressions namespace to handle the basic validation for my UI's. I create a validation object where I have different types of validation patterns that I enumerate and return true or false. I am not sure of the correct name but I believe they are called predicates. It looks like this.
I
f(validate.vString(textbox1.Text, vType.Money)
{
Do what ever I need;
}
Else
{
Notify User and handle any rollback;
}

The method will have

The regularexpresion validator takes an expression like the following.
Regex re = new Regex(@"^(?!\u00a2)\p{Sc}?(?!0,?\d)(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?"); (I pulled this off the web a few months ago and I cannot remember who wrote it but they did a good job) and then is returned by the ismatch method.

One of the features I like about this is the number of resources available to me on the web to get patterns. Since I tend to write business apps it is pretty important to me to have a flexible means of validating the inputs (decimal places, sku's, email and addresses) and so far this has worked.

Hope it helps. If you find a better way be sure and share since I am always looking to improve my apps. Smile | :)



It looks complicated for validation but after you get use to it and the expressions it works real well.
GeneralRe: Only 2 decimal places for data in a textbox Pin
myNameIsRon14-Sep-04 19:09
myNameIsRon14-Sep-04 19:09 
GeneralRe: Only 2 decimal places for data in a textbox Pin
sreejith ss nair14-Sep-04 18:34
sreejith ss nair14-Sep-04 18:34 
GeneralRe: Only 2 decimal places for data in a textbox Pin
myNameIsRon14-Sep-04 19:03
myNameIsRon14-Sep-04 19:03 
GeneralRe: Only 2 decimal places for data in a textbox Pin
sreejith ss nair14-Sep-04 19:10
sreejith ss nair14-Sep-04 19:10 
GeneralRe: Only 2 decimal places for data in a textbox Pin
Stefan Troschuetz15-Sep-04 0:19
Stefan Troschuetz15-Sep-04 0:19 
GeneralRe: Only 2 decimal places for data in a textbox Pin
myNameIsRon15-Sep-04 18:24
myNameIsRon15-Sep-04 18:24 
General#define Pin
gmhanna14-Sep-04 16:33
gmhanna14-Sep-04 16:33 
GeneralRe: #define Pin
sreejith ss nair14-Sep-04 18:39
sreejith ss nair14-Sep-04 18:39 
GeneralRe: #define Pin
mav.northwind14-Sep-04 19:53
mav.northwind14-Sep-04 19:53 
GeneralRe: #define Pin
mebmer 12345678914-Sep-04 21:50
mebmer 12345678914-Sep-04 21:50 
GeneralHANDLE Pin
eggie514-Sep-04 14:39
eggie514-Sep-04 14:39 
GeneralRe: HANDLE Pin
Colin Angus Mackay14-Sep-04 14:56
Colin Angus Mackay14-Sep-04 14:56 
QuestionHow to change the text of a text object at runtime in crystal reports for .NET (C#) Pin
Member 119488414-Sep-04 11:45
Member 119488414-Sep-04 11:45 
AnswerRe: How to change the text of a text object at runtime in crystal reports for .NET (C#) Pin
sreejith ss nair14-Sep-04 18:42
sreejith ss nair14-Sep-04 18:42 
AnswerRe: How to change the text of a text object at runtime in crystal reports for .NET (C#) Pin
Member 119488414-Sep-04 20:08
Member 119488414-Sep-04 20:08 
Generalaccessing listbox items on a form from another class Pin
mr spoon14-Sep-04 10:20
mr spoon14-Sep-04 10:20 
GeneralRe: accessing listbox items on a form from another class Pin
Heath Stewart14-Sep-04 11:45
protectorHeath Stewart14-Sep-04 11:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.