|
<<< In the name of GOD >>>
Hi.
I have question about Owner-Draw ListBox.
I added Owner-Draw with my ListBox, and use of color and icon in ListBox.
My problem is, when i add a string with ListBox i can't see string !!!
ATTENTION 1: i can see icon or color in ListBox
My source code in Owner-Draw :
void CHlistbox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
CRect rc = lpDrawItemStruct->rcItem;
UINT action = lpDrawItemStruct->itemAction;
if(action & ODA_DRAWENTIRE)
{
pDC->FillSolidRect(rc,RGB(20,10,5));
}
}
ATTENTION 2: I add string when dialog want to load
My source code about adding a string with ListBox :
BOOL CListBoxDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
m_listbox.AddString("Hadi");
return TRUE;
}
Please help me ... or send to me FULL example about Owner-Draw in ListBox
Hadi Rezaie
|
|
|
|
|
I believe owner drawn mrans YOU have to output the string.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
what christian means hadie is that the strings should be drawn AFTER you fill the color in or you are overwriting your text with the color
i think
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Hi all,
I'm kinda new here and was hoping someone could help me out with a problem. I have a combobox and I want people to be able to select from the combo box with the mouse, by clicking on it, but not scroll through the combobox with the keyboard... so if they click on the combo box and make a selection I dont want them to be able to then scroll down the combobox with the arrow keys. Any advice would be appreciated.
Thanks,
--Dave
|
|
|
|
|
This sounds to me like a colossally bad idea ( changing default behaviour so your combo will not behave as your user expects ), but assuming you have a good reason to do it...
From what I can see, you'll need to create a class derived from a combo box. Then you can capture the key press for the arrows and ignore it. OR you could catch ON_CBN_DROPDOWN, and set a bool to tell you if the list has been dropped, and based on that in ON_CBN_SELCHANGE you can know if the selection change is from an arrow press or list box click. Sounds like a lot of work to me, but that's how I would do it ( probably just the first suggestion )
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
One way you could do this is to derive a class off of CComboBox, overide the PreTranslateMessage function and add code like this:
if (GetDroppedState() && (pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP || pMsg->message == WM_CHAR))
return TRUE;
Just my 2cents worth.
|
|
|
|
|
How can I show Modaless Dialog and stop the treatment of the CView (I have leftView and View) when Modaless´ Cancel button is clicked. Thanks. I´m desperate.
|
|
|
|
|
I'm not sure what you are asking ?? To show a modeless dialog, you would make a pointer to one a member variable so you can create it and it won't go out of scope. I tend to put
If (Create(IDD, pParent))ShowWindow(SW_SHOW);
in my constructor so that creating my modeless dialog also shows it. In order to do something in your main view based on the pressing of cancel, you would override OnCancel and do whatever you want there. For example, you could write a function in your mainframe that does what you want, and call it like this
CMainFrame* pMain = (CMainFrame*) AfxGetMainWnd();
pMain->MyFunkyFunction();
I posted an answer yesterday where I showed how to get pointers to view and doc objects also.
Hope that helps.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hey guys,
Once again I need your help. I am desiging this funky gui control that requires me to create this odd region for buttons. Basically take a square and superimpose a circle in the center offset from the borders of the suare by 5 pixels. Got a vague picture in your head?
Ok now with that picture in your head, think of the space left at each of the 4 corners...there are my button regions that i created. Now my next hurdle is to overlay a bitmap over that region.
Any ideas on how i could do it? It has to be possible.
Thank you for any input
"DWORD my man!"
|
|
|
|
|
Use SelectClipRgn on the Device context of the Bitmap Button Control and BitBlt the Bitmap on to it.
Subbi.
|
|
|
|
|
Is it possible to take an existing MFC based app (say something based on MDI) and wrap it into an OCX for placement in a web browser? I know we'd have to do some things to de-MFC/MDI some of the application but is there somewhere to look for at least how perhaps we could approach this if it is even possible???
Thanks!
|
|
|
|
|
even if you could the size of the resulting activex would be so huge nobody would want to download it probably
maybe use atl instead?
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Please, help me! How can I show Modaless Dialog and stop the treatment of the CView (I have leftView and View) when Modaless´ Cancel button is clicked. Thanks.
|
|
|
|
|
What's a No Modal dudette? DO you mean a modeless dialog?
|
|
|
|
|
yes, I am so sorry. I was thinking in a modeless dialog. Ups!
|
|
|
|
|
am very sorry but your english makes it impossible to understand what you are asking ... is there anyway you can write it better?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Yeah, I know this is trivial,
But does anyone know how to calculate the orthodox and nonothodox Easter Friday Dates From a Year Value.
I'm thinking it could make a Kool Easter Egg system to implement
Regardz
Colin Davies
Ownguide NZ
|
|
|
|
|
I think you need to know the phases of the moon.
Perhaps we can add a moon tracking service to the OS. You would then be able to divide up the phase into ticks, much as the GetTickCount does ('cept they chose a 49.7 day cycle, for efficiency.)
All we have to do is sync with the great cosmic moon 'puter (running at Cern, I believe) during bootup, then our apps can call GetLunaTicCount to determine the current proximity to the new moon. If there are no LunaTics, its a miracle, and it must be Easter.
|
|
|
|
|
I found this - from Gauss - apparently how its actually done for Easter Sunday:
CString strEaster;
ldiv_t ldResult;
int R1, R2, R3, R4, R5;
int Y = 2001;
ldResult = ldiv(Y,19);
R1 = ldResult.rem;
ldResult = ldiv(Y,4);
R2 = ldResult.rem;
ldResult = ldiv(Y,7);
R3 = ldResult.rem;
ldResult = ldiv((19*R1) + 24,30);
R4 = ldResult.rem;
ldResult = ldiv((2*R2)+(4*R3)+(6*R4)+5,7);
R5 = ldResult.rem;
if(R4 + R5 >=10)
strEaster.Format("April %d", R4+R5-9);
else
strEaster.Format("March %d", R4+R5+22);
Guess you could fiddle to get the Friday. For Greek Orthodox, I guess if you had the full rationale for the formula you could adapt it. Must be more interesting stuff on the web - just thought this was neat - apparently it even takes into account the lunar cycles I was on about. Wow. Gauss rulez.
|
|
|
|
|
How to detect different type of Internet connection (RAS, TAPI, xDSL..)?
|
|
|
|
|
I think it's not easy, if not possible at all.
A starting point could be the InternetGetConnectedState() function, or searching on MSDN.
Paolo.
|
|
|
|
|
Hi All,
How can I create service in Windows 98 ? In Windows NT/Windows 2000 we have CreateService function ? I'm working on WDM Filter driver and I want to pass message to it ? I have done it in Windows 2000 by Creating it as service but how can I create it as service in Windows 98 ?
Thanks,
Puneet
|
|
|
|
|
I am starting to look into writing some TSR programs and haven't found any good articles or examples. Does anybody know of any urls or places where I can learn more about programming them? Thanks in advance,
- Travis
|
|
|
|
|
hey travis
tsr programming ... now that takes me back ... terminate and stay resident apps were a dos thing that let you make the system look like it was multitasking when in fact it wasnt ... in windows you don't really need such things
are you doing dos work? or are you just not understanding the difference with the windows way of doing things?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Hi,
I am new to visual C++ programming and I need some help please. How can I access a simple int variable defined in a Document from within a Modal Dialog?
I thank you in advance,
Christos P.
|
|
|
|