|
Alright kash....
Use Class Wizard to attach a CString to the Static Control, and a CComboBoxCtrl to the ComboBox.
Then Use Class Wizard again to catch the Message CBN_SELCHANGE for the ComboBox
in the function generated for that action,
OnSelChange...
int i = m_comboBox.GetCurSel();
switch (i) {
case 0:
m_string = "meters";
case 1:
m_string = "feet";
};
UpdateData(TRUE);
or something like that.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Jawache wrote:
UpdateData(TRUE);
Thats bad!!!
From now on, clicking cancel has changed your data.
This should not happen, because a user that clicks cancel specifically wants to leave the dialog *WITHOUT* change in the data.
But the call to UpdateData() copied the control status of all controls into the corresponding variables. So with cancel, they are changed.
So - do not fill the DDX-variable yourself and call UpdateData() !
Better use a control variable of type CStatic and do a SetWindowText() on it.
|
|
|
|
|
It should have been UpdateData(FALSE) anyway.
Usually you have the data stored seperately anyway.
if (Dialog.DoModal() == IDOK)
{
m_String = Dialog.m_String;
}
so only after a user clicks OK is the data stored away otherwise the old data is valid.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
try ON_CBN_SELCHANGE notify
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I've created a progress bar that works, except it is misplaced. How do I make my progress bar a child of my status bar? The vertical position is the only one wrong. My progress bar shows at the top of the screen. Here's the OnSize code:
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if (IsWindow(m_wndStatusBar.m_hWnd) &&
IsWindow(m_ProgBar.m_hWnd) &&
m_ProgBar.GetSafeHwnd()) {
CRect rect;
m_wndStatusBar.GetItemRect(2, &rect);
//Reposition the progress control correctly
m_ProgBar.SetWindowPos(&wndTop,
rect.left,
rect.top,//returns 2 (of main window, not status bar)
rect.right - rect.left,
rect.bottom - rect.top,
NULL);
}
}
Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
RalfPeter wrote:
How do I make my progress bar a child of my status bar
By passing pointer to CStatusBar instead of CMainFrame to CProgressCtrl::Create. Did you read the KB article?
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
KB article? Which one is it? I've read many articles on the subject. My code seems to conform to all of them and I don't remember seeing any article addressing pointer to CSatusBar, even though it makes sense to me. Could you help me further by giving me an article title or, better, by giving me a one-liner for the piece I need. Something like:
CStatusBar *status = (CStatusBar*)AfxGetApp()->m_pMainWnd;
Thanks for your reply,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
|
Hi,
I'm trying to add multiline tooltip support to my normal, (CToolBar in CReBar in CMainFrame) ToolBar.
I've found lots of code for MultiLine ToolTips for normal buttons in Dialogs etc.. but nothing specifcaly for ToolBars.
Currently I'm trying to get COXToolTipCtrl to work,
I've set the tooltips as normal with AddTool etc...
I've relayed the Pretranslate messages from CMainFrame to the ToolTip but it only shows the first tooltip and not the others.
Does anyone have any advice?
cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Sorry i'm an idiot,
didn't read the comments at the end of the article properly.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I don`t want save my XML message to disk and than call Navigate2. It should be more beautiful algorithm.
|
|
|
|
|
There is no XML in the IE API. However writing content in XML format using C++ is a breeze. If you do it using javascript ActiveX scripting it should even be easier as you may take advantage of the MSXML COM component, if it's installed.
Once it's done, navigate2(localfile) works fine.
And I swallow a small raisin.
|
|
|
|
|
You may do XSLT transformation on XML. The result should be a HTML. Then you can pass this HTML to IE as InnerHTML
|
|
|
|
|
Hi all, I finally was able to get my Word Automation project to work,
somewhat. I was never able to find a way with Office 97 but Office
2000 and XP, I was able to find a way. But I am having one problem.
When I launch Word from my application, everything seems to work
fine. Except when I decide to open an existing word document. It
opens the document but it does it in an entirely new Word window, not
in the existing window like it usually does. Any ideas what might be
causing this? Any ideas how to get around this?????? I am
stumped...
|
|
|
|
|
I thought this is how Word 2000 and beyond works. When I moved from Office 97 to 2000 one thing I noticed with Word and Excel etc was that each document was opened in a new Window. This may be an options setting. It did not bother me so I did not investigate. But you may want to look into it.
|
|
|
|
|
Thanks. I actually did look into it and after A LOT of digging, I finally found an answer on Microsoft's website. According to MS, Office 97 and earlier was created using the MDI design. But Office 2000 and Office 2002 was created using the SDI design. You are correct, there is a setting that can be turned on or off to do what is wanted. It is under Tools, then Options, and on the View tab, uncheck the Windows in Taskbar. This will bring up multiple documents in one instance.
|
|
|
|
|
I have two Acccess flat databases, each with a number of fields that may overlap. I want to by
code merge these two databases. Any clues? I'm using ADO with the #import statement and msado25.tlb.
say db1 has all the fields that db2 has, and db2 just has one extra field. Then I want the db1 merged part to have a special text entry "special entry" in its record values, while the db2 part has the values that it has already.
|
|
|
|
|
Create a select statement that will join the two tables based on some common key and then select the relevant fields. Though I am not exactly very clear on what you are trying.
|
|
|
|
|
Hi all,
anybody knows like disable [autoscroll] in a CEditView (multiline) ?
My instance is readonly and I add text always in append after then the CEditView scroll automatically automatically at the end.
Thank's,
Gigi
|
|
|
|
|
I am not sure about this, but you may want to set current selection at the top of the control after you've appended the text.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I click an item with right mouse button treectrl doesn't change selected item, so I don't know how to find out which item was clicked( as far as I know NM_RCLICK handler doesn't provide anything helpful ). I'm not sure whether it is possible to get handler of clicked item. I will apreciate any help.
|
|
|
|
|
I'm using ::GetMessagePos, CTreeCtrl::ScreenToClient and CTreeCtrl::HitTest.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
It's not very elegant in my opinion but it should work (I haven't checked it), but anyway thanks for help!
|
|
|
|
|
Anonymous wrote:
It's not very elegant in my opinion
If you find more elegant solution, let me know.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Tomasz' solution sounds fine to me, but if you don't like it then i'd suggest subclassing the tree control & installing your own WM_RBUTTONDOWN handler; you'll probably find all sorts of other uses for subclassing the control anyway.
Shog9
|
|
|
|