不好意思....想問一問:
dim a, b, c, d as integer
dim sum as integer
if RadioButton1.checked then
a=1
elseif RadioButton2.checked then
b=2
elseif RadioButton3.checked then
c=3
elseif RadioButton4.checked then
d=4
else 
sum=0
endif這樣,我想用select case 做可以嗎???

解决方案 »

  1.   

    这样就挺好,为什么要用 SElect Case ?况且你这种情况,好像不能用 SElect Case 吧,我没想出来,静等高人吧。
      

  2.   

    嗯~~~我都是只想到這個方法....但我要設定20多個RADIOBOTTON....就是想看看有沒有一些方法可以減少代碼.....謝謝你~
      

  3.   

    有沒有一些函數,可以控制FORM中的所有RadioButton??一個一個的定義很煩人...
      

  4.   

    你把radionbutton放到一个数组里面
      

  5.   

    @@可以的嗎????
    是不是這樣:dim radiobutton_arry() as object = new object(0){}radiobutton_arry(0)=radiobutton
    是這樣嗎???不太明白,,,,新手..
      

  6.   

    本帖最后由 bcrun 于 2011-05-16 13:54:27 编辑
      

  7.   

    没用过RadioButton控件,vb6下试试:dim a, b, c, d as integer
    dim sum as integer
    select case true
        case RadioButton1.checked: a=1
        case RadioButton2.checked: b=2
        case RadioButton3.checked: c=3
        case RadioButton4.checked: d=4
        case else: sum=0
    end select