我怎么判断checkbox是被勾了的呢?
我如何判断RadioGroup1里面哪个item是被选了的呢?

解决方案 »

  1.   

    我要实现的功能就是判断checkbox是被勾了的就把它的caption放到一个str1里面。
    判断RadioGroup1的蒙个item是被点了的就把它的caption放到一个str2里面。
      

  2.   

    if checkbox.checked:=true then
    checkbox.caption
    for i:=0 to radiogroup.item.coutn-1do
    beign
     if radiogroup.itemindes[1].checked :=true
    then
      str:=caption
    endn
      

  3.   

    if checkbox1.Checked:=false then
    begin
    s1:=checkbox1.caption;
    end;
    怎么编译不过呢?
      

  4.   

    应该 是if checkbox1.checked=false then
     s1:=checkbox1.caption
      

  5.   

    ":= "NOT equals to 
     
    "="if checkbox1.checked then  // if checkbox1.checked = true then
      

  6.   

    谢谢你,checkbox没有问题了,但是:
    for i:=0 to radiogroup1.items.Count-1 do
    begin
     if radiogroup1.ItemIndex[1].check:=true
     //itemindes[1]
    then
      s2:=caption;
    end
    有问题?
      

  7.   

    .checked  is already an boolean value ,so "= true " is not necessary!
      

  8.   

    for i:=0 to radiogroup1.items.Count-1 do
    begin
     if radiogroup1.ItemIndex.checked then
      s2:=caption;
    end
    对吗?
      

  9.   

    if radiogroup1.ItemIndex[1].check     :=     trueu didn't found the problem yet ?
      

  10.   

    你看嘛,我知道问题在那里,但是我改了呀:if radiogroup1.ItemIndex.checked then
    怎么还是编译不过呢?
      

  11.   

    radiogroup1.ItemIndex是整型的,
    整型是简单类型
    包括checked 成员吗??~!!!!!
    当然编译不过去
      

  12.   

    procedure TForm1.FormCreate(Sender: TObject);begin
      RadioGroup1.Items.Add('Vertical');
      RadioGroup1.Items.Add('Horizontal');
      RadioGroup1.ItemIndex := 2;
    end;procedure TForm1.RadioGroup1Click(Sender: TObject);begin
      if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Vertical' then
        ScrollBar1.Kind := sbVertical;
      if RadioGroup1.Items[RadioGroup1.ItemIndex] = 'Horizontal' then
        ScrollBar1.Kind := sbHorizontal;end;例程
      

  13.   

    procedure TForm1.RadioGroup1Click(Sender: TObject);
    var
    i:integer;
    begin
    for i:=0 to form1.RadioGroup1.Items.Count-1 do
      begin
      if radiogroup1.itemindex=i then showmessage(inttostr(i+1));
      end;
    end;
      

  14.   

    很明显不对了!!我只是在输入的时候太快了这是很明显的,你可以看出来的!!
    FOR I:=0 TO RADIOGROUP1。ITEMS。COUNT-1 DO
    BEGIN
    IF RADIOGOUP1。ITEMINDEX=I THEN
    S2:=RADIOGOU1。ITEMS[RADIOGOUP1。INDEX];