Discussion:
Query: How to add a checkbox control in Tab [ Win 32 project, None MFC/.NET ]
(too old to reply)
Arif
2010-01-06 08:06:17 UTC
Permalink
Hi All,
I am using VS 2008. I wanted to add a checkbox inside a tab
control in a simple Win32 project.
but it's not straight forward it seems.

This how I did it

step 1: Created a Visual C++->Win32->Win32 Project
it created a winows application project....
step 2 : double click RC file of project , went to dialog ...
there is one dialog automatically generated by VS2008..
about dialog...
double clicked it

step 3: increased size of this dilaog ...

step 4 : Clicked Tab control in Toolbox and created a tab on this
about dialog

step 5: clicked checkbox in toolbox and created a check box in visual
boundies of Tab control....
assuming that it will create a check box inside tab
control but it did not....

step 6: Moving tab control shows clearly that checkbox is not inside
it...it's outside tab

step 7 ... tried looking in properties of Tab control , could not
figoure out any property which will do this ...
moreover also could not figure out how to add/delete/edit
tabs...using properties panel of VS2008


Searching over net shows me only MFC and .Net solutions, but could not
find anything related to plain Win32 controls.

even on the msdn i wasn't able to find anything other than this
http://msdn.microsoft.com/en-us/library/w149892x.aspx
which is a .Net solution...

I think it's a very basic problem, and I am missing something very
basic ..any help would be appreciated.

Thanks in advance,

-Arif
Timo Kunze
2010-01-06 10:14:22 UTC
Permalink
Post by Arif
moreover also could not figure out how to add/delete/edit
tabs...using properties panel of VS2008
You do this at runtime.

Concerning the check box, you usually create a border- and captionless
dialog for each tab and assign them to the tab strip at runtime.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
Arif
2010-01-06 10:45:15 UTC
Permalink
Post by Timo Kunze
You do this at runtime.
Concerning the check box, you usually create a border- and captionless
dialog for each tab and assign them to the tab strip at runtime.
Ohh ok .. that's a long way to do it,
Thanks I could not find it anywhere documented.


VS 2008 IDE should have provided a way to do it design time :(
I wonder why they din't.

If you have any URL of any documentation/tutorial explaining it please
share.
or if you have any sample code demonstrating
1) How to assign borderless/Caption less dialog to tab at runtime
please share ...
2) how to add/delete tabs at runtime...


Thanking you in advance..
Timo Kunze
2010-01-06 12:57:00 UTC
Permalink
Post by Arif
If you have any URL of any documentation/tutorial explaining it please
share.
or if you have any sample code demonstrating
1) How to assign borderless/Caption less dialog to tab at runtime
please share ...
2) how to add/delete tabs at runtime...
http://msdn.microsoft.com/en-us/library/ms632588.aspx
http://msdn.microsoft.com/en-us/library/bb760548.aspx

You should also have a look at Property Sheets. Maybe they fit your
needs better.
http://msdn.microsoft.com/en-us/library/bb774540.aspx

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
Arif
2010-01-06 13:59:28 UTC
Permalink
Post by Timo Kunze
http://msdn.microsoft.com/en-us/library/ms632588.aspx
http://msdn.microsoft.com/en-us/library/bb760548.aspx
You should also have a look at Property Sheets. Maybe they fit your
needs better.http://msdn.microsoft.com/en-us/library/bb774540.aspx
Timo
Thanks A lot Timo.
I will go through the URLs you have given.
Thanks again.
-Arif
Frank Schnabel
2010-01-07 01:42:54 UTC
Permalink
I've actually done this in projects. My method was to not use a checkbox
control, but rather a bitmap of a checkbox added to the tab using the
image member of either the TCITEM or TCITEMHEADER structure (I don't
remember which) and do a hit test when the user clicks the mouse button to
determine if the checkbox bitmap was clicked. If I find some sample code
I'll post it.


Frank
Post by Arif
Hi All,
I am using VS 2008. I wanted to add a checkbox inside a tab
control in a simple Win32 project.
but it's not straight forward it seems.
This how I did it
step 1: Created a Visual C++->Win32->Win32 Project
it created a winows application project....
step 2 : double click RC file of project , went to dialog ...
there is one dialog automatically generated by VS2008..
about dialog...
double clicked it
step 3: increased size of this dilaog ...
step 4 : Clicked Tab control in Toolbox and created a tab on this
about dialog
step 5: clicked checkbox in toolbox and created a check box in visual
boundies of Tab control....
assuming that it will create a check box inside tab
control but it did not....
step 6: Moving tab control shows clearly that checkbox is not inside
it...it's outside tab
step 7 ... tried looking in properties of Tab control , could not
figoure out any property which will do this ...
moreover also could not figure out how to add/delete/edit
tabs...using properties panel of VS2008
Searching over net shows me only MFC and .Net solutions, but could not
find anything related to plain Win32 controls.
even on the msdn i wasn't able to find anything other than this
http://msdn.microsoft.com/en-us/library/w149892x.aspx
which is a .Net solution...
I think it's a very basic problem, and I am missing something very
basic ..any help would be appreciated.
Thanks in advance,
-Arif
Arif
2010-01-08 19:49:11 UTC
Permalink
Hi Timo and Frank,
Thanks a lot for giving me the URL and
hints how to handle this,
I have understood it quite a bit but i think I am first exploring
other ways ( other than pure Win32 programming) to
do the same using Delphi, MFC, .NET etc... .NET Forms based sultions
looks quite good ..
exploring them if they can successfullt integrated into my
application...

Thanks for your help guys...
you rock..
-Arif

Loading...