#### dialog on tab page getting lost

Hi
I have followed
http://www.codersource.net/mfc_ctabctrl.html
to place the tab control on the dialogbox which is derived from
CDialog.

But when I enter the return or escape key , tab page dialog is getting
disappeared.

I put the following code for the dialog but no use.

BOOL CCableDia::PreTranslateMessage(MSG* pMsg)
{

if (pMsg->message == WM_KEYDOWN)
{

if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
{
pMsg->wParam = NULL;

return TRUE;
}
}

return CDialog::PreTranslateMessage(pMsg);
}


 0
yang__lee (48)
4/18/2006 11:13:35 AM
vc.mfc 33608 articles. 0 followers.

3 Replies
845 Views

Similar Articles

[PageSpeed] 12

yang__lee@ausi.com wrote:
> Hi
> I have followed
> http://www.codersource.net/mfc_ctabctrl.html
> to place the tab control on the dialogbox which is derived from
> CDialog.
>
> But when I enter the return or escape key , tab page dialog is getting
> disappeared.

Override the OnOK an OnCancel functions in the tab page dialog.  Make
your functions empty: Do not call the CDialog version.

--
Scott McPhillips [VC++ MVP]


 0
Scott
4/18/2006 12:37:22 PM
> But when I enter the return or escape key , tab page dialog is getting
> disappeared.

Look here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q122489

---
Ajay


 0
ajaykalra (6842)
4/18/2006 1:18:49 PM
To add to what Scott wrote, you may want to close the tab control (or main
dialog) when they press the Esc key which typically cancels a dialog.  The
problem is that the child is closing, but the parent is not close so you get
the effect of a blank spot in the middle of your tab control.  You didn't
mention the name of the child dialog so I don't know if that is where you
are putting your PreTranslateMessage() override.  If the child dialog on the
tab control has focus it will get the Esc before the parent is notified (if
that's how it is set up).

Tom

<yang__lee@ausi.com> wrote in message
> Hi
> I have followed
> http://www.codersource.net/mfc_ctabctrl.html
> to place the tab control on the dialogbox which is derived from
> CDialog.
>
> But when I enter the return or escape key , tab page dialog is getting
> disappeared.
>
> I put the following code for the dialog but no use.
>
> BOOL CCableDia::PreTranslateMessage(MSG* pMsg)
> {
>
> if (pMsg->message == WM_KEYDOWN)
>        {
>
>            if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
> {
> pMsg->wParam = NULL;
>
> return TRUE;
> }
>       }
>
>
> return CDialog::PreTranslateMessage(pMsg);
> }
>


 0
tserface (3861)
4/18/2006 3:17:52 PM

Similar Artilces:

Lost Cash Flow Function in Money 2002
Not sure what the catalyst was but I have recently lost the ability to view my cash flow forecast. Clicking the toolbar icon does nothing excpet refresh the screen I'm in and the cash flow forecast component of the home page seems stuck on an obscure account. I have tried the Quick Repair, downloaded the Salvage tool & run a Level 2 (Standard) Repair with no effect. However, whilst following the instructions to perform a deep repair, Salv.exe does not allow me to perform the level 3 repair - it does not give that option in the drop-down box. 2 questions... has anyone experien...

Change window title in dialog app...
I'm using AfxMessageBox to inform my users as to some action. How do I change the title (it's usually the project name) of the window that's created? In a normal SDI or MDI I can go to the string resource and change the AFX_IDS_APP_TITLE, but there is no string resource for a dialog based app. Any clues? Thanks, Fred you can use ::MessageBox instead "sftwrdvlpr" <bogus@news.com> wrote in message news:LYNdb.4962$%U5.2113@newssvr29.news.prodigy.com... > I'm using AfxMessageBox to inform my users as to some action. How do I > change the title (it'... Help I think I lost most of my records I ran a filter, changed one field in one of the filtered records and clicked the save, thinking I was saving the change to that record. The filter icon went off when it saved and now my 1000+ records are only 17. What do I do??? If i understand your question correctly, then all it requires is that you go up to the top of your window there and click on the "remove filter" button. So far as i know, a filter never removes records, it only hides them. a Query removes or changes which records actually exist in a table. "Rondo" wrote: > I ran a filter, changed one... how to redraw the bitmap in a dialog box hello, Can someone tell how to do this since i have been struggling with it for more than 2 weeks. My application draws a series of bitmaps on the dialog box one after the other. Its something like an animation where i read the bitmaps from a file and draw each one subsequently in a specified region of the dialog box using "dc.bitblt" in a while loop in the OnPaint message handler.Everyhtin is working fine but the problem arises when i move this dialog box outside the client area of the application and then move it back in or minimise the application and maximise it again. Then the O... Allen Brown's Flexible search-How do get rid of duplicates? Hello all! I've created a flexible search like the one described by Allen Browne at http://allenbrowne.com/ser-62.html. It works great, except that it shows duplicates records as results. I know why this happens: I have a one-to-many relationship between my Master table and by DocAnalysts and DocTaxes tables. Since each record can have more than one analyst or tax type, it's showing up multiple times as a result of the search. Is there any way I can fix this? The form itself is based on a query that links all three tables by DocID. I've played around with the unique values/u... Connection Lost Message I recently installed MS CRM 40 on a new Windows Server 2003 server. We are using MS Office 2007 SP1. The CRM Outlook client works just fine, but I keep getting a message popping up in my task tray that says the following: "Unable to Connect Still unable to connect to Microsoft Dynamics CRM. MS wil restore the connection when possible. to stop retrying, right-click and select Sign Out." It gives me this error even though I can work fine in outlook?? Any ideas what the system is trying to do? Thanks, Seth ... Get paid daily just for being our member ! Get paid daily just for being our member ! After you join MyFreeShares ( for free ), you will get 1 share. You will be able to earn more shares by referring other people to our service ( 1 share per referral + 1 Share per Dollar they spend on advertising on our page ), or you can earn shares with clicking links and for joining Free and paid offers or with purchase advertising on our site. You will earn more money every day, if you have more shares. http://www.myfreeshares.com/banner.php?ref=hfzj2005 ... Continued from page Is there a more efficient way of setting the "continued from/on page" message into another language. In concurrent use of multiple languages, it's cumbersome to switch the "default" language for each document. Not to my knowledge. -- "Nino Alvarez" <anonymous@discussions.microsoft.com> wrote in message news:08d001c401fa$5d04bd60\$7d02280a@phx.gbl... > Is there a more efficient way of setting the "continued > from/on page" message into another language. In concurrent > use of multiple languages, it's cumbersome to switch &g...

Force Report Footing to print at bottom of page
Hhi, I'm using Access on Office XP Pro. Is there anyway to force the Report Footing (not page footing) to print at the bottom of the current page. Currently, the report ends 10 lines into a new page, so the report footing start printing on line 11. I would like it to print at the bottom of the page. Is there anyway to do this? -- Dennis On Tue, 2 Feb 2010 12:38:03 -0800, Dennis wrote: > Hhi, > > I'm using Access on Office XP Pro. > > Is there anyway to force the Report Footing (not page footing) to print at > the bottom of the cu...

Publish w/o having to manually change links to get them to work
To get my web links (to my pages) to work, I have to manually type the whole url and file name to get them to work on the uploaded page. When I do this, the selected state feature no longer works. Answered in the Publisher web group... DavidF "ummibra" <ummibra@discussions.microsoft.com> wrote in message news:91940BCC-3958-4E4A-B8F6-CC97ED741887@microsoft.com... > To get my web links (to my pages) to work, I have to manually type the > whole > url and file name to get them to work on the uploaded page. When I do > this, > the selected state feature no...

Hey, what's the URL to that IEEE floating-point number page?
You know, the one people post when someone doesn't understand why 22 / 10 yields 2.2000000000000000000001 instead of 2.2. Jeff Johnson wrote: > You know, the one people post when someone doesn't understand why 22 / 10 > yields 2.2000000000000000000001 instead of 2.2. > > Goldberg, I presume you mean??? <http://docs.sun.com/source/806-3568/ncg_goldberg.html> -- Hello, > You know, the one people post when someone doesn't understand why 22 / 10 > yields 2.2000000000000000000001 instead of 2.2. You could try : http://en.wikiped...

Question about getting OS language version in VC++
Dear all, I am writting an application with VC++. I want to ask how to obtain the information of the language version of the Window OS ? For example, for Window 2000 English version, how to know that the Window 2000 is in "English" version even if the locale setting in control panel is set to Chinese or other non-English language. If anyone knows this issue, can you tell me what method can get this information. Urgent, Thanks. Thanks, Benny Take a look at the GetSystemDefaultLCID() API. Use LANGIDFROMLCID & PRIMARYLANGID macros to get the language id from ...

How do I show what page I am on
I have a brochure with front and back pages. I was able to (w/in the last week) see the page 1 or 2 in a small box down in the left hand corner. Now it is gone and it looks like there is only one page to the document. Any ideas out there? thanks, E View, status bar... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Eileen" <Eileen@discussions.microsoft.com> wrote in message news:E483BB1F-3DD2-4428-BD5D-DF14EA536736@microsoft.com... >I have a brochure with front and back pages. I was able to (w/in the last &...

Print preview look different than the page I am creating
I created a poster on a page 8.5 x 11. I use a background gray that fills the entire page. When I select Print Preview, there is a white border around the page. Why is this and how do I get rid of it? Is this just to frame my poster and doesn't it print on the page? I'd like to know before I print because this will use up a lot of ink that I don't wish to waste. "DTravz" <DTravz@discussions.microsoft.com> wrote in message news:4B7AF632-28B0-4610-BA34-D25886401C2E@microsoft.com... > I created a poster on a page 8.5 x 11. I use a background gray that fills th...

Filtering in the page field of a pivot table
I have two separate fields in the page field section of my pivot table. How can I set it up so that once you have chosen a value in the drop down box of the first field, only values relating to the first field appear in the drop down box of the second ? At the moment all values appear in the drop down box of the second field, regardless of what you have chosen in the first. Hope this makes sense ! There's no setting that will filter one page field based on the selection in another page field. Tim wrote: > I have two separate fields in the page field section of my > piv...

How do I add a page from one file to another file?
I am working on a newsletter with several others. I have several one page files in PUB 03 and want to combine them into one file. I have tried copying but I only get a new text box. Any thing that I copy and paste is a new text box. I have tried removing the orrignal text box, but I still only get a tex box. I have the same problem in moving text from page to page in the same file. I have even tried copying to Word and recopying, but still just a text box. -- Mr MC 8 Do you *select all?* What happens when you *paste special?* Are you inserting a page in the new publication and then ...

Why do I get this ###### instead of 11:00 p.m. in formatted cell?
One reason could be that the column isn't wide enough. Try widening the column. -- Biff Microsoft Excel MVP Always supply your formula and the values of the input cells -- Kind regards, Niek Otten Microsoft MVP - Excel "new user" <new user@discussions.microsoft.com> wrote in message news:32404C0C-FB66-4D90-A301-42D0322E2CFE@microsoft.com... | On 15 =F1=E5=EF, 19:43, new user <new u...@discussions.microsoft.com> wrote= : > Not to forget: if cell contains fomula that evaluates time value and result turns to be negative, it will be shown as ###### no...

Buy 1 get 1 of a equel or lesser Value
I would like to do a Buy 1 get 1 discount that works on a Mix and Match. Presently RMS will not do the lesser value automaticly. We must do a manual sort at the POS. I have seen this function in custom POS's. If RMS would allow for Item sorting on the display before tendering a Macro could be desiged to do most of this. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open ...

Printing right to the edge of the page without borders???
I have an image that I need to print to the exact page size (A5). I have changed the image dimensions to match the page dimensions but when I print it keeps cutting part of the iamge off?? Does anyone know how I can fix this?? Sharina wrote: > I have an image that I need to print to the exact page size (A5). I > have changed the image dimensions to match the page dimensions but > when I print it keeps cutting part of the iamge off?? Does anyone > know how I can fix this?? ======================== Maybe your printer doesn't print full bleed (edge to edge)? "How to find ...

Getting a strange error when I try to view an XML file from VS.NET
The error message that I'm getting is: "Cannot find the file 'C:\text.xml' (or one of its components). Make sure the path and filename are correct and that all required libraries are available". I've attached the file that I have saved at C:\text.xml. It's a simple XML file that I threw together for testing. But it's giving me that error. Does anyone have any idea why I might be getting this, and (more importantly) how I can fix it? Thanks! -Scott begin 666 test.xml M/#]X;6P@=F5R<VEO;CTG,2XP)R!E;F-O9&EN9STG=71F+3@G(#\^#0H\<75O M=&4^#0H\5&...

Lost PST files when transferring
I was transferring archived pst files from one archive to another. They we rather large file (~400Mb) during the transfer, my computer went to a DOS screen and told me that it was doing a memory dump. I was forced to reboot to get back. I have been able to recover some of the files ( they were left in the original archive folder. Many of the files (those already transferred I cannot find. I checked the registry and error logs and noted an event that appeared at the smae time inndicating a "minidump" had occured. I found the file, it has a .dmp extension, but is only about 2...

getting OWA to work after moving website
Hello all, I have moved my website to a different server that does not have Exchange on it. I am not sure how to get the OWA back to working on the website again. I have been looking on Technet and havent been able to find an answer. Can someone help me or point me in the right direction? Thank you in advance for your help and advice. Scott You'll have to install Exchange on the new server. Alternatively you could redirect from the new server to the old server. Nue "Scott" <Scott@discussions.microsoft.com> wrote in message news:F4F36D58-30CB-4443-94D0-E031CE76B6...

All pages display on each page
I am having a problem with 2002 version that displays every page in the publication as one. Essentially every page is overlayed on every other page which makes the whole thing look like a big mess. Any suggestions as to how to cure this ? You maybe experiencing video driver failure. Do this, slide the acceleration down on your adapter, control panel, display folder, settings tab, advanced button, troubleshoot tab, slide the acceleration down a couple of notches. If this solves your issue go to the manufacturer's web site of your graphics card and look around for an upgraded driver. D...

Outlook Junk Filter- I have it on Safe List
I'm running Outlook 2003 with the latest update. Looking at my Safe Sender's list, there are only email addresses and all appear to be valid to me. I have checked automatically trust email from my Contacts list and automatically add people that I email to the Safe Sender's List. Same with Safe Recipients List. I have one blocked sender (that idiot- support@citibank) and have done nothing with Internationsl settings. I HAVE created several rules that mainly block certain words in the body. I'm puzzled as to why, with that tight level of filtering, why so much still gets...

event log error
Every now and then (roughly every 4 or so hours) i'm getting three event log errors in a row. They all refer to a problem with a mailbox but unfortunately where it should say the mailbox name it's blank. i.e. "Event ID: 8231 Calendar agent failed to determine the primary calendar for mailbox: . " note the full stop and gap where the mailbox name is. then "Event ID: 1022 Logon Failure on database "First Storage Group\Mailbox Store (BILBO)" - Windows 2000 account NT AUTHORITY\SYSTEM; mailbox /O=AMT/OU=LondonExc/cn=Configuration/cn=Servers/cn=BILBO/cn=Mi...