兩條 C# 問題 , plx help

1.  遇到 error  就重新黎過 (即係好似restart咁)
2. textbox 一定要入 number

HOW TO DO IT ?

thx

1.
public xxx(){
try {

}
catch {
xxx()
}
}
咁樣得唔得?

2. textbox.Numeric
bool, Check 係唔係數字

TOP

1 用LOOPING都得

TOP

原帖由 ioptional 於 2008-10-21 07:08 PM 發表
1.
public xxx(){
try {

}
catch {
xxx()
}
}
咁樣得唔得?

2. textbox.Numeric
bool, Check 係唔係數字


1. 就係唔想咁
我想放係if 入面
if (statement){
show error;
reload;
}

2. 請問 code 點寫 ?

thx~

TOP

原帖由 sckds 於 2008-10-21 19:03 發表
1.  遇到 error  就重新黎過 (即係好似restart咁)
2. textbox 一定要入 number

HOW TO DO IT ?

thx


guess what is this for

if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
            }

TOP

原帖由 sckds 於 2008-10-21 19:29 發表


1. 就係唔想咁
我想放係if 入面
if (statement){
show error;
reload;
}

2. 請問 code 點寫 ?

thx~


1.
public xxx(){
try {

}
catch {
show error;
xxx()
}
}
咁樣呢

TOP

原帖由 AlexAu 於 2008-10-21 19:36 發表

1.
public xxx(){
try {

}
catch {
show error;
xxx()
}
}
咁樣呢


yes

try
{
}
catch (Exception e)
{
MessageBox.Show (e.Message)
}

TOP

原帖由 AlexAu 於 2008-10-21 07:36 PM 發表


1.
public xxx(){
try {

}
catch {
show error;
xxx()
}
}
咁樣呢


我唔想用try........
我想放係if 入面
if (statement){
show error;
reload;
}

TOP

原帖由 rocketdive04 於 2008-10-21 07:30 PM 發表


guess what is this for

if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
            }


ching , 個 KeyChar 點彈出黎架 ?

小弟初學 , 問左低能野有怪莫怪

TOP

原帖由 sckds 於 2008-10-21 19:40 發表


我唔想用try........
我想放係if 入面
if (statement){
show error;
reload;
}


what kind of error you want to show?

TOP