Solved

C++ Win32 TabControl + Dialog (resources)

Posted on 2015-01-12
4
437 Views
Last Modified: 2016-11-10
Hello! How are you?

I'm trying to use resources but i found a problem.

I did a Dialog, added a tabcontrol, i want to use another dialog to display my controls in tab 1, so it's more easy to hide everything.

I'm doing this in the main callback dialog:

case WM_INITDIALOG:{
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "aaaaaaa", 0);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "bbbbbbb", 1);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "ccccccc", 2);
	TWin::Inst().hwnd = CreateDialog(NULL, MAKEINTRESOURCE(frmSecond), GetDlgItem(hWnd, IDC_TAB1), (DLGPROC)SecondProc);
	return TRUE;
	break;
}

Open in new window


screenshot about it
frmSecond = "IDD_FORMVIEW" type in visual studio.

IDC_TAB1 the tab control in resources.

What i need to do?

Ty!
0
Comment
Question by:Júlio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:Júlio
ID: 40546475
Idk if it is corret, but i'm setting the x,y position to fix it. But when i create it, it should be inside the tabcontrol, no?=(
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 40546917
Hi dm0000,

IMO you have to move the child dialog to down/right because I think it overlaps the tabs of the tab control. And I think it's clear because for a tab control the client-rect equals the window-rect, so placing a child dialog on client coordinate 0, 0 causes it to be place at the top/left of the complete tab control.

I think (allthough I'm not sure coz I didn't test) you can use the TCM_GETITEMRECT message to ask the tab control about the rectangle you can use for the child dialog.

Hope that helps,

ZOPPO
0
 

Author Closing Comment

by:Júlio
ID: 40547223
Yes, i'm doing this. Ty!
0
 

Expert Comment

by:a a
ID: 41882396
me too this problem
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question