|
For menu, your only chance is probably owner-drawing. For dropdown list - you'll have to get the listbox (the dropdown portion of combo) and set the font there. AFAIR that combo box gets WM_CTLCOLOR message before dropdown appears - this is your opportunity to get the HWND of listbox.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Donno about the popup menu, but you can just call SetFont() (MFC; straight Win32 is WM_SETFONT ) for the drop-down list. If you only want the actual list portion of the drop-down to have a different font, Tomasz's trick will work nicely as well.
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
Hi,
I have to admit I'm learning Shell Namespaces as I'm going along.
I want to Know how to find out if a PIDL refers to a Drive, the only way I can think of how to do this is to Get the PIDL for MyComputer and Enumerate this then compare all of the SubPIDLS with the PIDL i have.
Is there a simpler method?
Thanks
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Anyone know a good ACM audio compression turorial?
Thanks in advance.
|
|
|
|
|
Anyone know an api call that will allow writing to cdr media. IoControl does not seem to work, i know i can implement what i need with a device driver but am trying to avoid going that route
|
|
|
|
|
I'm having a problem making the horizontal scrollbars appear in a list box in my application. I created it with the dialog editor and have the horizontal & vertical scrollbar boxes checked on the properties dialog. The vertical scrollbar does appear when the enough items are placed in the box. However, the horizontal never appears. i've tried moving controls around to insure their is room for the scroll bars to appear. I've compared the properties to another list box in the application which does display the horiz scroll bars when necessary.
Are there any situations that anyone knows which would cause the scroll bars not to appear in a CListBox?
Thanks in advance,
Bob
|
|
|
|
|
AFAIR, horizontal scrollbars work only with multi-column listbox.
If you want to scroll your items horizontally and you have only one column, consider switching to listview control.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
You need to call CListBox::SetHorizontalExtent() . The value passed in the arg will cause the horizontal scrollbar to appear if it's more than the current width of the scrollbar.
It's nicer to subclass CListBox and override AddItem() , InsertItem() and DeleteItem() so that they recompute the current max length of the list box's strings and call SetHorizontalExtent() themselves.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks! that did the trick.
Bob
|
|
|
|
|
Bob, this[^] is what you should be using!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote: You need to call CListBox::SetHorizontalExtent(). The value passed in the arg will cause the horizontal scrollbar to appear if it's more than the current width of the scrollbar.
Thanks for that, i have resolved one of my problem.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
How do i implement drag and drop between listboxes? Is there any example program??
Thanks
Dana
|
|
|
|
|
Is this what you're looking for?
link[^]
|
|
|
|
|
i am using an instance of CString class and i wana concatenate the strings with a new line character . i am unable to do with a help of "\n" so plz help me as early as possible.
Work Hard and Test your Luck
|
|
|
|
|
|
Hi!
You can do it lie this:
CString er="rui\r\n";
CString ff="santiago";
AfxMessageBox(er+ff);
you'll get
rui
santiago
Using \r\n you'll get the line feed.
Hope this helps
|
|
|
|
|
Hi,
I am using Visual C++ 6.0, in my project I create a ListControl which has 3 Header columns as Column1, Column2,Column3 (very simple).
When program is running, I would like to detect which "Header" Column that the user is selecting (Column1, 2 or 3) to proceed one particular function for that column
For now I am using Event: OnColumnclick() and success to know the user click on Header Columns ... but I still do not know which Column?
Can someone help me on this?
Note: Please remember detect mouse position is not help in this case, because user can adjust the column width on run time and it is difficult to calculate update range on Run Time. Imagine there are more columns & some out of the screen, then the user move Horzontal scroll bar to see the last 10 then selecting one ...!
I appreciate any one can help in this case.
Anh Truong
|
|
|
|
|
iSubItem member of NM_LISTVIEW (or NMLISTVIEW) identifies the column clicked.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hi,
Thank you, I did using your advice & comnine with Dazinith suggestion ---> it worked.
Thanks for help and I appreciate very much!
ATC
|
|
|
|
|
add the message handler..
ON_NOTIFY(HDN_ITEMCLICK, 0, OnHdnItemclickMylist)
add the function.. basicly you just check what column it was that was clicked.. i dunno how you would do it if you could rearrange the columns.. but as long as the columns stay in the same order you should be alright..
void CMyDialog::OnHdnItemclickMylist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
if (phdr->iItem == 1)
OnSortNum();
else if (phdr->iItem == 0)
OnSortName();
*pResult = 0;
}
-dz
|
|
|
|
|
Thank you for your help it works ... even the LPNMHEADER phdr = reinterpret_cast(pNMHDR); compile error I changed to this: HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;
Thank you for help, I am really appreciate it!
|
|
|
|
|
Hi! I'm working on a application that uses MSAccess database, i run SQL commands like :
kl.Format("%s%s%s","SELECT Maquina.nicname FROM Maquina WHERE Maquina.maquinaid='", machineid,"'");
pRst->Open((_bstr_t)kl, strConn, adOpenStatic, adLockReadOnly, adCmdText);
Therefor, to use this commands i need this two variables :
_RecordsetPtr pRst("ADODB.Recordset");
_bstr_t strConn("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=proteres.mdb");
I've been defining them locally in all my functions, but now i was trying to make them global for the all application, or even the same class, but i get always the same compile errors for the declaration:
error C2059: syntax error : 'string'
error C2059: syntax error : 'string'
I tried to declare them like:
class CMachine_financial_information : public CDialog
{
// Construction
public:
CMachine_financial_information(CWnd* pParent = NULL, CString maquina=""); // standard constructor
// Dialog Data
//{{AFX_DATA(CMachine_financial_information)
enum { IDD = IDDU_MACHINE_FINANCIAL_INFORMATION };
CListCtrl m_lstcFinanceiro;
CString m_static_tempo;
CString m_static_collected_money;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMachine_financial_information)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public:
LVITEM lvi;
SortInfo m_SortInfo;
CCtrlSort m_CtrlSort;
----> _RecordsetPtr pRst("ADODB.Recordset"); <------
----> _bstr_t strConn("DRIVER={Microsoft Access Driver <------(*.mdb)};DBQ=proteres.mdb");
// Implementation
protected:
//{{AFX_MSG(CMachine_financial_information)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangecomboperiod();
virtual void OnCancel();
afx_msg void Oncancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void dinheirocofre(CString, int);
void enchelistctrl(CString);
CString machine;
};
Can anyone help me with this problem?
Thank you in advance
|
|
|
|
|
I don't think you can initialize the _bstr_t in the header at least not with that syntax
----> _RecordsetPtr pRst("ADODB.Recordset"); <------
----> _bstr_t strConn("DRIVER={Microsoft Access Driver <------(*.mdb)};DBQ=proteres.mdb");
|
|
|
|
|
Thanks, do you think i should cast them into another data tye, which should be the best option?
Thank you
|
|
|
|
|
How can I get the name of the program that have created a window given its HWND
|
|
|
|