I have tried looking up how this is done, but with not too much luck. In the end, I would like to have a edit control for every tab created. But as of now, all I have is an edit control on top of the tab control.
void CreateTab(HWND hwnd)
{
//--------------------------------------------------------------------------------
//Tab Control
RECT rcClient;
TCITEM tie;
// Get the dimensions of the parent window's client area, and
// create a tab control child window of that size.
GetClientRect(hwnd, &rcClient);
TAB = CreateWindow(WC_TABCONTROL, "",
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | TCS_FIXEDWIDTH | TCS_SINGLELINE,
0, 0, 0, 0,
hwnd, (HMENU)ID_TAB, hInst, NULL);
WHy not use a PropertySheet to contain propertypages which host the edit control ? You are saved a lot of trouble if you use property pages.
zaryk
September 29th, 2008, 07:27 PM
ill look into property pages....ive never used them before so...
Marc G
September 30th, 2008, 09:17 AM
The way the tabcontrol works is that it's just a tabcontrol. You are responsible to show/hide the controls according to which tab is active.
Property sheets might indeed be better suited.
zaryk
September 30th, 2008, 10:26 PM
Property sheets may be better suited but it seems more difficult to do.
kirants
October 1st, 2008, 12:07 PM
On the contrary, property sheets and pages are in fact designed for this very purpose. It does all the ground work of showing hiding when you tab, setting focus , handling keyboard tabbing and all that.
Where are you setting the property page template in the psp[0] structure ? Since there is no template, page construction is going to fail.
zaryk
October 3rd, 2008, 07:13 PM
Based on the other few examples i could find....i got this..but it doesnt seem right
//UnkEditProp.h
#define DLG_FONT
//UnkEditProp.rc
#include "UnkEditProp.h"
1005 DIALOG 0, 0, 80, 134
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
kirants
October 3rd, 2008, 08:18 PM
Check out sample attached. I replaced the about dialog with propertysheet. Note how simple it is.
zaryk
October 3rd, 2008, 10:49 PM
.....the only problem is that yours is:
if click about, then show property sheet.
.....when I want it to just show up, for example:
notepad++ has either tab control or property sheets....dont have to click anything
devc++ has either tab control or property sheets....dont have to click anything
thats what I got so far and nothing is changing that.
kirants
October 3rd, 2008, 11:25 PM
You need to add PSH_MODELESS flag.
zaryk
October 4th, 2008, 12:32 AM
Ok now that a dialog box shows up.for some reason without tabs.......how do i get it to show up in the main window?
kirants
October 5th, 2008, 11:54 PM
Not clear what you mean by main window ? Did you set the main window as the parent in the propertysheetheader ?
Also, you will have to resize the window accordingly after propertysheet creation.
zaryk
October 7th, 2008, 11:44 PM
You know, I am just going to stop asking for help. There have been so many stupid questions asked in response to something that I have said, and it makes me feel like people are really dumb. Even I know what a main window is when people talk about it. There is the main window....commonly referred to as hwndMain or some variation.
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
I want the property sheet to show up in the big gray spot of the main window in the previous pic I attached. How hard can that be? This apparently isn't as simple as what you said it was. Thanks for your help anyway.
kirants
October 8th, 2008, 12:52 AM
Not one person that responded to you said you are dumb, but you responded to those who tried to help you by calling their replies as stupid questions. That is a very interesting view :)
Why are you hesitating to post your working project here? Was that a stupid question in your opinion ? In your last post also you added some code that has nothing to do with your problem.
zaryk
October 10th, 2008, 01:57 AM
Maybe you should read carefully. I said "There have been so many stupid questions asked in response to something that I have said, and it makes me feel like people are really dumb." So, I was calling other people dumb. Second, of all I was posting part of the code that dealt with the latest question, which happened to be about the main window. And third of all, ive worked on my program for a long time, and overcome difficulties (and still more to come) many times to get where i have on it. I am not going to just post all my code to make it easier on other people.
Igor Vartanov
October 10th, 2008, 04:04 AM
Maybe you should read carefully. I said "There have been so many stupid questions asked in response to something that I have said, and it makes me feel like people are really dumb." So, I was calling other people dumb. Second, of all I was posting part of the code that dealt with the latest question, which happened to be about the main window. And third of all, ive worked on my program for a long time, and overcome difficulties (and still more to come) many times to get where i have on it. I am not going to just post all my code to make it easier on other people.Nobody here is interested in your precious code, so keep it for yourself. :thumbd: :thumbd: :thumbd:
You would look back at tab controls. As long as I can see you used to overcome difficulties, it would be no problem to you with that, you know, I'm perfectly sure of that.
Martin O
October 10th, 2008, 05:12 PM
Maybe you should read carefully. I said "There have been so many stupid questions asked in response to something that I have said, and it makes me feel like people are really dumb." So, I was calling other people dumb. Second, of all I was posting part of the code that dealt with the latest question, which happened to be about the main window. And third of all, ive worked on my program for a long time, and overcome difficulties (and still more to come) many times to get where i have on it. I am not going to just post all my code to make it easier on other people.
zaryk, maybe you should lose the dumb idea that people here are obligated to help you.
zaryk
October 10th, 2008, 10:33 PM
As for Igor, you should probably expand your English vocabulary, you left out a few words.
And I don't think people are obligated to help me, I just think that, as elite members that they are, they should be able to help me without any problems.
Marc G
October 11th, 2008, 11:17 AM
Please keep the discussion on topic.
Thank you.
Martin O
October 11th, 2008, 11:41 AM
zaryk, you should probably lose the silly misconception that a member obtains 'elite' status by passing some sort of qualifying test. They get to be elite by answering LOTS of questions & along the way getting thanks, in the form of reputation points, from the people they helped. There isn't some 'code guru elite certification exam' if thats what you thought lol. Try using your brain sometimes. Speaking of using your brain, do you really think anyone is going to want to continue to help you with your horrible attitude? Concentrate that little brain of yours & think about it. I've worked on win32 property sheets & wizards. Would I help you with it? Hell no. Based on your attitude. And also based on the fact that you've already got Kirants helping you, who probably doesnt remember me, but I remember him helping me ALOT when I started using win32. As you can see, he is kind to a fault (I think he shouldnt have contintued to help you after your temper tantrum). And he definitely knows his stuff.
Its up to *you* to make your question as clear as possible. Its not up to the people from whom you are asking for help to 'not waste your time' & read between the lines & fill in the missing peices themselves.
I know whats happening....you're having a lot of difficulty with programming, getting frustrated, & blaming everyone else for your difficulties. Get over it. No one said it would be easy. And no, you are not entitled to anything.
Martin O
October 11th, 2008, 11:43 AM
Please keep the discussion on topic.
Thank you.
Sorry Marc, didnt see your post. I'll leave it alone now.
zaryk
October 11th, 2008, 10:36 PM
well, that was a fun conversation. But, either way, since property sheets are dialog based, then I am going to create a dialog based application in order to what i am wanting to do.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.