• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-22  評論-7  文章-0  trackbacks-0

            環(huán)境WindowsXP,BCB6.0(UPD4 (English)
            Form1(主Form),F(xiàn)orm1上有Button1,點擊Button1顯示Form2。
            Form2上有一個RadioGroup1和Edit1,在Form2的OnShow事件中,
            進行RadioGroup1->ItemIndex = StrToInt(Edit1->Text);賦值操作。Edit1->Text默認值0。
            Form2顯示后,在界面上選擇與StrToInt(Edit1->Text)不同的選項后關(guān)閉Form2。假設(shè)選擇了第二項。
            回到Form1,重新打開Form2,這時應(yīng)該顯示的是RadioGroup1->ItemIndex = 0;
            可是結(jié)果卻顯示為第二項。


            PS:Form1,F(xiàn)orm2都是自動創(chuàng)建的Form。

            From1.cpp代碼如下
            //----------------------------Head Begin-----------------------------------------------
            #ifndef Unit1H
            #define Unit1H
            #include <Classes.hpp>
            #include <Controls.hpp>
            #include <StdCtrls.hpp>
            #include <Forms.hpp>
            #include <ExtCtrls.hpp>
            //---------------------------------------------------------------------------
            class TForm1 : public TForm
            {
            __published: // IDE-managed Components
                    TButton *Button1;
                    void __fastcall Button1Click(TObject *Sender);
            private: // User declarations
            public:  // User declarations
                    __fastcall TForm1(TComponent* Owner);
            };
            //---------------------------------------------------------------------------
            extern PACKAGE TForm1 *Form1;
            //---------------------------------------------------------------------------
            #endif
            //---------------------------Head End------------------------------------------------


            //---------------------------Cpp Begin------------------------------------------------
            #include <vcl.h>
            #pragma hdrstop

            #include "Unit1.h"
            #include "Unit2.h"
            //---------------------------------------------------------------------------
            #pragma package(smart_init)
            #pragma resource "*.dfm"
            TForm1 *Form1;
            //---------------------------------------------------------------------------
            __fastcall TForm1::TForm1(TComponent* Owner)
                    : TForm(Owner)
            {
            }
            //---------------------------------------------------------------------------

            void __fastcall TForm1::Button1Click(TObject *Sender)
            {
                Form2->Show();
            }
            //--------------------------Cpp End-------------------------------------------------


            Form2代碼如下
            //--------------------------Form2  Head Begin-------------------------------------------------

            #ifndef Unit2H
            #define Unit2H
            //---------------------------------------------------------------------------
            #include <Classes.hpp>
            #include <Controls.hpp>
            #include <StdCtrls.hpp>
            #include <Forms.hpp>
            #include <ExtCtrls.hpp>
            //---------------------------------------------------------------------------
            class TForm2 : public TForm
            {
            __published: // IDE-managed Components
                TRadioGroup *RadioGroup1;
                TEdit *Edit1;
                void __fastcall FormShow(TObject *Sender);
            private: // User declarations
            public:  // User declarations
                __fastcall TForm2(TComponent* Owner);
            };
            //---------------------------------------------------------------------------
            extern PACKAGE TForm2 *Form2;
            //---------------------------------------------------------------------------
            #endif
            //-----------------------------Form2 Head End----------------------------------------------


            //-----------------------------From2 Cpp Begin----------------------------------------------

            #include <vcl.h>
            #pragma hdrstop

            #include "Unit2.h"
            //---------------------------------------------------------------------------
            #pragma package(smart_init)
            #pragma resource "*.dfm"
            TForm2 *Form2;
            //---------------------------------------------------------------------------
            __fastcall TForm2::TForm2(TComponent* Owner)
                : TForm(Owner)
            {
            }
            //---------------------------------------------------------------------------

            void __fastcall TForm2::FormShow(TObject *Sender)
            {
                RadioGroup1->ItemIndex = StrToInt(Edit1->Text);

            }
            //------------------------------From2 Cpp End---------------------------------------------


            解決方法:
            在TForm2::FormShow加入RadioGroup1->SetFocus(); 

            void __fastcall TForm2::FormShow(TObject *Sender)
            {
                RadioGroup1->SetFocus(); //加入
                RadioGroup1->ItemIndex = StrToInt(Edit1->Text);

            }

            posted on 2010-07-05 15:53 楚天清秋 閱讀(1728) 評論(1)  編輯 收藏 引用 所屬分類: C++ Builder

            評論:
            # re: BCB的RadioGroup控件的ItemIndex屬性BUG! 2011-01-23 11:23 | 人渣
            用showmod.. 顯示模式對話框看看。
            要是還不行,就用hide,不用close。
            似乎也見過。  回復(fù)  更多評論
              
            久久久无码精品午夜| 婷婷久久综合| 2021国产精品午夜久久| 怡红院日本一道日本久久 | 国产叼嘿久久精品久久| 精品无码久久久久久久动漫| 久久精品国产亚洲一区二区三区| 欧美亚洲另类久久综合婷婷| 久久久久久人妻无码| 99久久综合狠狠综合久久| 久久伊人色| 国产韩国精品一区二区三区久久| 久久国产免费直播| 久久久久免费看成人影片| 久久人人爽人人精品视频| 久久九九精品99国产精品| 伊人伊成久久人综合网777| 99精品伊人久久久大香线蕉| 777午夜精品久久av蜜臀| 久久精品国产精品亚洲人人| 精品久久8x国产免费观看| 人妻无码久久精品| 亚洲国产精品久久久久| 无码人妻精品一区二区三区久久久| 久久WWW免费人成—看片| AV无码久久久久不卡网站下载| 亚洲精品无码久久久| 久久性精品| yellow中文字幕久久网| 久久线看观看精品香蕉国产| 久久婷婷国产综合精品| 久久久久国产精品人妻| 久久久久久午夜精品| 午夜福利91久久福利| 久久久噜噜噜久久| 久久综合亚洲色HEZYO国产| 狠狠色伊人久久精品综合网 | 久久一区二区三区免费| 久久久WWW成人免费毛片| 欧美大战日韩91综合一区婷婷久久青草| 久久青草国产手机看片福利盒子|