|
// *********************************************************
// ダイアログ初期化イベント
// *********************************************************
void MyDlg::WMInitdialog()
{
this->CenterWindow();
// ダイアログのプロパティでシステムメニューのチェックボックスを外して下さい
this->ChangeStyle( WS_MINIMIZEBOX | WS_SYSMENU, 0 );
this->ChangeExStyle( WS_EX_APPWINDOW, 0 );
this->ChangeIcon( IDI_HM040 );
this->StatusCreate( 0 );
LboxString Buff;
// MySQL 接続文字列
Buff.operator = ("MySQL,lightbox,root,");
CurDb.SetConnectString( 3, &Buff );
// 処理区分(コンボボックス)
Type = new LboxCombobox( this->GetHandle( IDC_TYPE ) );
Type->Add( "1", "登録" );
Type->Add( "2", "修正" );
Type->Add( "3", "削除" );
Type->Select( 0 );
// 社員コード
this->EditLimitText( IDC_KEY, 4 );
this->EditNumberonly( IDC_KEY, true );
// 氏名
this->EditLimitText( IDC_NAME, 50 );
// 所属(コンボボックス)
Syozoku = new LboxCombobox( this->GetHandle( IDC_SYOZOKU ) );
// 作成日(日時指定コントロール)
CreateDate.hWnd = this->GetHandle( IDC_CREATEDATE );
// 所属コンボボックスに所属データをロード
LboxString Query(100);
if ( CurDb.Connect() ) {
Query.operator = ("select コード,名称 from コード名称マスタ");
Query.operator += (" where 区分 = 2");
Query.operator += (" order by コード");
CurDb.LoadSqlData( Syozoku, &Query );
CurDb.DisConnect();
}
else {
MsgOk("データベースの接続に失敗しました");
this->EndFlg = true; // プログラム終了
return;
}
// プログラムID(プロジェクト名)
LboxString LWork(100);
LoadString(
this->Instance(),
IDC_HM040,
LWork.szLboxString,
100
);
this->EditSetText( IDC_PROGID, &LWork );
this->EditFocus( IDC_KEY );
}
| |