c 控制項常用函式

2021-09-12 02:59:25 字數 841 閱讀 5647

updatedata();//將資料從控制項複製到控制項變數

cstring username;//字串變數的定義

cwnd::getcheckedradiobutton 

函式功能:在給定的一組單選框id中獲得當前被選中的單選按鈕的id  

函式原型:int getcheckedradiobutton( int nidfirstbutton, int nidlastbutton );  

返回值: 當有被選中的單選框時返回被選中的單選框的id ,如果所給的組中都沒被選中則返回0  

引數:  nidfirstbutton 單選框組中第乙個整形值的id

nidlastbutton 單選框組中最後乙個整形值id

getdlgitemtex()呼叫這個函式以獲得與對話方塊中的控制項相關的標題或文字

//單選框選擇並獲取其文字

uint nid=getcheckedradiobutton(idc_radio_man,idc_radio_woman);

getdlgitemtext(nid,***);

messagebox("使用者已存在");

把【m_1】和【m_2】的值按照【%s】的格式傳給字串【select * from 資料庫表 where 使用者名稱='%s' and 密碼='%s' 】。

比如:m_1=張三,m_2='abc' 那麼出來的結果就是:

【select * from 資料庫表 where 使用者名稱='張三' and 密碼='abc'】

m_precordset=m_pconnection->execute(sql,null,adcmdtext);

while(!m_precordset->adoeof)

C 常用控制項縮寫

收集了常用的控制項縮寫以備查用 控制項名稱 縮寫 buttom按鈕 btncheckbox核取方塊 chkcolumnheader檢視列表頭 colcombobox組合框 cbocontextmenu快捷選單 ctmdatagrid資料網格控制項dg datagridview資料網格檢視控制項 dg...

常用 API 函式 控制項與訊息函式

adjustwindowrect 給定一種視窗樣式,計算獲得目標客戶區矩形所需的視窗大小 anypopup 判斷螢幕上是否存在任何彈出式視窗 arrangeiconicwindows 排列乙個父視窗的最小化子視窗 attachthreadinput 連線線程輸入函式 begindeferwindow...

C 常用函式

1 datetime 數字型 system.datetime currenttime new system.datetime 1.1 取當前年月日時分秒 currenttime system.datetime.now 1.2 取當前年 int 年 currenttime.year 1.3 取當前月 ...