2009-12-02 10 views
8

का उपयोग कर विंडो एप्लिकेशन (win32 एपीआई) में नियंत्रण के लिए टूल टिप कैसे जोड़ें, मेरे पास दृश्य सी ++ में एक विंडो एप्लिकेशन (win32 API) है जिसमें मुझे नियंत्रण बटन में टूल टिप्स जोड़ना होगा। क्या कोई उपरोक्त कार्य को प्राप्त करने में मेरी मदद कर सकता है? अग्रिम में धन्यवाद।विजुअल सी ++ 2008

+0

आप MFC उपयोग करते हैं? –

उत्तर

2

आप उपयोग नहीं करते हैं MFC कक्षाओं को देखने About Tooltip Controls

यहाँ एक उदाहरण CToolTipCtrl वर्ग उपयोग कर रहा है,

// Init a tooltip window  
m_ToolTipCtrl = new CToolTipCtrl; 
m_ToolTipCtrl->Create(this); // 'this', usually a CDialog window 

m_ToolTipCtrl->SetMaxTipWidth(300); // if you need multiline messages 
m_ToolTipCtrl->SetTipBkColor(0x000000); 
m_ToolTipCtrl->SetTipTextColor(0xe0e0d0); 

// Attach a CListBox control (we can attach many controls) 
m_ToolTipCtrl->AddTool(plstBox, "Hey, i am a tooltip message!"); 


// ... 
// (*) We must use the following in order to use tooltips (MFC 4.0 and later versions) 
BOOL MyDialog::PreTranslateMessage(MSG* pMsg) 
{ 
    if (NULL != m_ToolTipCtrl) 
     m_ToolTipCtrl->RelayEvent(pMsg); // <- listen mouse messages! 


    return CDialog::PreTranslateMessage(pMsg); 
} 
+0

मैं एमएफसी का उपयोग नहीं कर रहा हूं, लेकिन आप जवाब देने के लिए मेरी समस्या को हल करते हैं धन्यवाद। –

संबंधित मुद्दे