Solved

C++ Win32 TabControl + Dialog (resources)

Posted on 2015-01-12
4
419 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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

749 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