Recent Comments

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

2014年1月21日 星期二

wwDBLookupCombo動態設定打開下拉選單時要顯示的內容

一般來說可以直接在屬性欄位中的selected中就可以設定要顯示的欄位內容
但因為在不同的資料表共用一個元件時,會因為不同的資料表欄位
而造成要動態去設定要顯示的內容,在切換時先clear,把之前的設定清除
然後用append或add去把後面的字串加入
lcn是欄位名稱
10是要顯示的欄位寬

以下的設定中有很多的\t \r \n這些,目前主要是直接看在屬性欄位設定好後所抓出的字串
wwDBLookupCombo->Selected->Clear();
wwDBLookupCombo->Selected->Append("lcn\t10\tlcn\t\t\r\n");
wwDBLookupCombo->Selected->Append("road_name\t40\troad_name\t\t\r\n");


實際測試最少要在欄位名稱和欄位寬的中間加入\t即可
wwDBLookupComboAddEquipmentLcn->Selected->Clear();
wwDBLookupComboAddEquipmentLcn->Selected->Append("lcn\t10\tlcn");
wwDBLookupComboAddEquipmentLcn->Selected->Append("road_name\t40\tnroad_name");




2014年1月16日 星期四

[BCB]找出同一層內的Component

找出同一層內的Component
於function可以再定義要找的Component type

this->test(this->GroupBox1);
======================================================
void TForm1::test(TWinControl* pObj)
{
    for (unsigned short int i=0 ; iControlCount ; i++)
    {
            if (String(pObj->Controls[i]->ClassName())==”TEdit”)
            {
                ((TEdit *)pObj->Controls[i])->Text = “get it”;
            }
            if (String(pObj->Controls[i]->ClassName())==”TLabel”)
            {
                ((TEdit *)pObj->Controls[i])->Text = “get it”;
            }
    }
}

2014年1月14日 星期二

MSSQL 防止儲存需要資料表重建的變更

當修改MSSQL資料表的資料型態或是否null時出現『防止儲存需要資料表重建的變更』
主要是因為某些設定會造成格式不符資料流失所出現的提醒,但在開發建立時會時常修改
可以在
『SQL Server Management Studio(SSMS) ->工具->選項->設計師->資料表和資料庫設計工具』
頁面中的『防止儲存需要資料表重建的變更』取消勾選後點選『確定』即可。