|
주소록을 만들고 있는데요...
이름, 나이, 전화번호, 이메일을 입력하고 추가 버튼을 눌렀을 경우 Tcombobox에 저장하고
Tcomcobox에 저장된 이름을 선택하고 조회를 눌렀을 경우
txtName->Text
txtAge->Text
txtPhone->Text
txtEmail->Text
에 보여주는것을 해야 하는데 Tcombobox에 어떻게 넣어야 하는지 모르겠어요...
고수님 좀 도와주셔요..^^
//---------------------------------------------------------------------------
void __fastcall TForm1::btnAddClick(TObject *Sender)
{
Set start;
if(txtName->Text.Trim().IsEmpty()) ShowMessage("이름을입력하세요");
else if(txtAge->Text.Trim().IsEmpty()) ShowMessage("나이를입력하세요");
else if(txtPhone->Text.Trim().IsEmpty()) ShowMessage("전화번호를입력하세요");
else if(txtEmail->Text.Trim().IsEmpty()) ShowMessage("이메일을입력하세요");
strcpy(start.name, txtName->Text.Trim().c_str());
start.age = txtAge->Text.Trim().ToInt();
strcpy(start.phone, txtPhone->Text.Trim().c_str());
strcpy(start.email, txtEmail->Text.Trim().c_str());
FILE *fp = fopen("info.dat","wb");
fwrite(&start, sizeof(start), 1, fp);
fclose(fp);
}
//---------------------------------------------------------------------------
|