Hi to all of you.I am totaly newbie in c# Visual studio.
ok here is the my problem
i must for homework do next.
i have 5 text box on form.a,b,c,d,e
in all of them i only must type NUMERIC format not letters.
now i must do next
mathematic > b/a = M
d/c= N
and then automaticly must show in e this result.
e=(1-(N/M))*100
can you understand my problem and can you please help me.
thank you. and sorry about bad english,
Loading
Rachit PatelPosted May 4, 2009, 8:33 AM
Below function help your enter only decimal value in textbox.
/*****************************************************************************
10.This function is used to Check for Currency entry in Textbox/Textarea/select box for the Empty,
Maximum value
Note1:If Required is set to false,then it validates only if you enter in the
input boxes.
Ex: fnCheckCurrency("document.frmAddEdit.txtCurrency","Amount","99999999.99",true);
******************************************************************************/
/************************ UPDATED BY CHITAL ON 31st October, 2006 ****************************/
function fnCheckCurrency(ObjectName,ObjectCaption,MaxVal,Required){
var strErr = ""
ObjectName=eval(ObjectName)
if(ObjectName.value.substring(0,1) == "$")
{
ObjectName.value=ObjectName.value.substring(1,ObjectName.length);
}
if(ObjectName.value == "0.00"){
l = 0;
}else{
l = ObjectName.value.length;
}
if (Required==true ||(Required==false && l>0)){
if(ObjectName.value.length <=0)
{
ObjectName.value=0;
}
else
{
var curEntered = ObjectName.value;
if (isNaN(curEntered)||fnIsEmpty(curEntered)){
strErr = ObjectCaption + " " + strErrValidCurrency + " \n\ " ;
}
else if (curEntered < 0){
strErr = ObjectCaption + " " + strErrNegativeValue + " \n\ " ;
}
else{
curEntered = parseFloat(curEntered)
if (curEntered > MaxVal){
strErr = ObjectCaption + " " + strErrExceed + " " + MaxVal + " \n\ " ;
}
}
}
if (strErr != ""){
strErrMessage = strErrMessage + strErr;
if ((objFocus == undefined)||(objFocus == "")){
objFocus = ObjectName
}
}
}else{return true;}
}
Aleksandar IlioskiPosted Mar 29, 2009, 8:16 AM
result = (1-(N/M)*100;// old code
result = Math.Sqrt(result);// new code
textBox5.Text = result.ToString();// old code that is all
Marin JurcaPosted Mar 28, 2009, 12:52 PM
i must sqrt finish result?
how to do that?
Aleksandar IlioskiPosted Mar 28, 2009, 11:47 AM
Marin JurcaPosted Mar 28, 2009, 7:37 AM
my program is working.
Aleksandar IlioskiPosted Mar 25, 2009, 5:28 PM
Marin JurcaPosted Mar 25, 2009, 11:58 AM
a = 16
b = 42
c = 17
d = 41
result in textbox.5 must be 8.12 %
Aleksandar IlioskiPosted Mar 25, 2009, 11:18 AM
Marin JurcaPosted Mar 23, 2009, 10:50 AM
thanks for answer.
here is the ss
http://img160.imagevenue.com/img.php?image=23219_kako_122_1103lo.JPG
Aleksandar IlioskiPosted Mar 22, 2009, 9:57 AM