PostMessage(WM_COMMAND,MAKEWPARAM(IDC_BTN_SIGNFOR_HSN,BN_CLICKED),NULL);
背景图:
::OnEraseBkgnd(CDC* pDC)
{
CDialog::OnEraseBkgnd(pDC);
CRect rect;
GetWindowRect(&rect);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
CBitmap bmpBackground;
bmpBackground.LoadBitmap(IDB_BITMAP1);
CBitmap* pOldMemBmp=NULL;
pOldMemBmp=memDC.SelectObject(&bmpBackground);
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,
bitmap.bmWidth ,bitmap.bmHeight+20,SRCCOPY);
return TRUE;
}
按钮:
HBITMAP hbitmap;
hbitmap= LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP_INTER_T));
((CButton*)GetDlgItem(IDC_BUTTON_INTER))->SetBitmap(hbitmap);
菜单:
// 显示菜单IDR_MENU_PTA
CMenu menu,*pmenu;
CRect rs;
GetDlgItem(IDC_BUTTON_AGENTOUTBOUND_PTA)->GetWindowRect(rs);
menu.LoadMenu(IDR_MENU_PTA);
pmenu = menu.GetSubMenu(0);
pmenu->TrackPopupMenu(TPM_CENTERALIGN | TPM_VCENTERALIGN,(rs.left+rs.right)/2,rs.bottom - 60,this);
//进行字符串分割组合
//宝201408-0001
//strKeyword=宝
CString strKeyword=strNewDeliverNo.Mid(0,2);
strNewDeliverNo.Delete(0,2);
//strDate=201408
int pos=strNewDeliverNo.Find('-');
CString strDate=strNewDeliverNo.Mid(0,pos);
strNewDeliverNo.Delete(0,pos+1);
//最终 strNewDeliverNo=0001
//获得当前时间 年月
SYSTEMTIME sys;
GetLocalTime( &sys );
CString time;
time.Format("%d%02d",sys.wYear,sys.wMonth);
CString strNo;
if(strDate==time)//最新送货批次的年月是否与当前年月相同,如果相同则批次+1;
{
int count= atoi(strNewDeliverNo);
count++;
strNo.Format("%04d",count);
}
else //与当前年月不相同则生成当前年月第一单送货批次
{ strNo="0001";
}
CString newDeliverNo;