|
Sounds complicated, so I will look for another way to enter month and year.
Thank you for your fast answer, Gerhard
|
|
|
|
|
If you are interested try a custom control, using COleDateTime class.
- NS -
|
|
|
|
|
m_datetimepicker.SetFormat ("yy-MM");<br />
can help you. <br />
<br />
Somethings seem HARD to do, until we know how to do them.<br />
;-)<br />
_AnShUmAn_<br />
<br />
<br />
-- modified at 4:47 Friday 9th June, 2006
|
|
|
|
|
Hallo,
But some things are HARD, even you got an answer that seems to be the solution.
I made my dialog with the wizzard and got a diaolg.cpp with a DoDataExchange-function like this:
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_begin);
m_begin is a COleDateTime-variable. But where and how do I have to place your Set.Format-code? I tried it with IDC-DATETIMEPICKER1 in an OnInital-function , in a PRECREATE-function, I tried it with the m_begin-variable, nothing works.
Thanks in advance, Gerhard
|
|
|
|
|
m_begin should be a control variable for the date time picker control .
Right click on the datetime picker contrl > add variable m_begin
in on initdialog use
m_begin.SetFormat()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hallo,
That works wonderful in my dialog, but I have a last problem. How can I get the valus of year and month at the end of the dialog. What I did till now was:
year.Format("%i", dialog.m_begin.GetYear());
month.Format("%i", dialog.m_begin.GetMonth());
And that doesn't work any more year and month are CStrings, but would not be a probelm if it would be int ore something other.
It's like it is always - the solution of one problem results in another problem
Thanks - Gerhard
|
|
|
|
|
|
Hi ,
I tried the following code in right mouse button clicked function for the List ctrl...It gives the submenu of the 5th menu in the menu bar...but its not giving the submenu where i right clicked the mouse button in the list ctrl
...
UINT nFlags;
CPoint point;
CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
CMenu* file_menu = menu_bar->GetSubMenu(5);
ASSERT(file_menu);
file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x,point.y, this);
Can anyone help me in this problem....
with regards,
Raja Bose
|
|
|
|
|
Raja Bose C Leo wrote: CPoint point;
From where you got the values of point? They should be in screen coordinates.
- NS -
|
|
|
|
|
thans for replying...
hmmmm i got it .... thans i got it .... thans for pointing out my mistakes..
hmmm its working fine
with regards
Raja Bose
-- modified at 2:47 Friday 9th June, 2006
|
|
|
|
|
Use CPoint point(GetMessagePos());
- NS -
|
|
|
|
|
whats value for point try this
<br />
CPoint point;<br />
GetCursorPos(&point);<br />
whitesky
|
|
|
|
|
Wow great its working fine.....
thans for ur help whitSky
once again thank u very much...
With regards
Raja Bose
-- modified at 2:57 Friday 9th June, 2006
|
|
|
|
|
you're welcome but
Raja Bose C Leo wrote: whitney
whitesky
|
|
|
|
|
Don't you think that GetMessagePos is better?
- NS -
|
|
|
|
|
|
I mean GetCursorPos will return the current position of the cursor, while GetMessagePos will return cursor position for the last message retrieved by the GetMessage function. So for processing a mouse click, it is better to get the position of the cursor at the time of that message was processed, rather than getting the current position, right?
- NS -
|
|
|
|
|
--------------------------------------------------------------------------------
Hello everyone,
I am discussing with my friends about an interesting question about find the maximum element in a set, which is the sum of two other elements.
For example, in set {1, 2, 3, 5, 8, 10}, the answer is 10 (10 = 8 + 2),
which is the maximum element we can find, and it is the sum of two
other elements (8 and 2) in the set.
Currently, I only have brute-force solution. Sorting the set, which takes O(nlgn) time, then enumerate them one by one to find whether two elements can sum up to the maximum element (if the most maximum element does not meet the condition, move to the second largest one), which takes O(n^2) time, so the total time complexity is O(n^2).
I am wondering whether any one have better ideas?
thanks in advance,
George
|
|
|
|
|
Hi to all,
In my project, I am using Combo-Box with following properties in ‘style’ tab,
Type : Drop List
Owner Draw : No
Sort : check mark
Vertical Scroll : check mark
Auto HSCroll : check mark
But when I run the code, for nay long string in the combo-box I can’t scroll horizontally.
Plz, help me to set the combo-box to view string in it’s list Horizontally also.
Thanks in advance,
Best Regards,
Aniket
|
|
|
|
|
|
I think, the horizontal scrolling is available only when type is "Dropdown" (i.e. the combo-box is editable) and Auto is true.
If no other solutions, you can switch to "Dropdown" type and try to obtain the handle of the combo-box’s child editor (using GetComboBoxInfo member in Window XP) and make it read-only.
|
|
|
|
|
Hi,
My dialog having CListCtrl and CComboxBox both are ownerdraw control. I place combobox on the listctrl cell. parent of the combo is listctrl. my problem is, the comboctrl is not placed with in the listrctrl cell. measureitem member function is raised when the parent of the combo is dialog or any frame work. how can i adjust the combox height. while creating the combo i give the rect of the listctrl cell. any one help me out.
Thanks In Advance.
Have A Nice Day!
Murali.M
|
|
|
|
|
i think you have one code for your work but see here maybe it is some helpful to you for combo in listctrlHere[^]
whitesky
|
|
|
|
|
Thanks for your reply. i already go through the code. here clistctrl is custom draw. but the combo is not. the sample u mension is combox is fully owner draw. i thnk u can understand my problem.
Have A Nice Day!
Murali.M
|
|
|
|
|
u got two ways
either increase the the height of row in listctrl to the height of combobox( This can be done by handling the measure item message )
or Decrease the height of the combobox by changing the font size
nave
|
|
|
|