Need Help to show Rich Editable text box and Datagrid in a tab or form, new to Visual C++ 2003
Hi,
I am quiet new to Visual C++ 2003 (Of course my exp is unix c++).
I would like to design a form (or form with tab) to show a editable textbox (I heard richtextbox) in the top aligned and datagrid below to show the records.
I designed it with richtextbox and datagrid. It works. I want to keep the richtextbox and datagrid to join together and user needs to increase and decrease the height of richtextbox depending on the need. The Richtextbox needs to increase and decrease at will of the user and reduced the gridsize decrease and increase so that the total height of richtextbox and datagrid is same.
What controls do i need to setup, and what properties (Key properties) do I need to concentrate. Need some guidance and help.
Thanks in advance,
Jil.
[772 byte] By [
Jil] at [2007-12-17]
Jil,
Traditionally this would be accomplished with the 'anchor' property and possibly a 'splitter' control. There is a really great example of using the splitter control at: http://www.devx.com/dotnet/Article/6964
If you choose not to use the splitter control you might consider anchoring the RichTextBox control to the top, left and right of the form and anchor the datagrid to the bottom, left and right. Then on the form's Resize event you can simply set the 'Height' property of each control based on the size of the form.
Alternately you might get a little more advanced and utilize the MouseDown and MouseMove events of your control. By using those events you can increase or decrease the height of each control depending on the direction of the mouse movements. This approach is a little unorthodox though.
-dsandor



Hi dsandor, Thanks for your detailed answer and your link.
I understand the anchoring, and the other explanation you have given.
Let me try this. Thanks again for your help.
Jil.
Jil at 2007-9-9 >

Hi dsandor,
You are simply great. You understood what I really wanted to know. The article you directed was quiet good and it resolved all my issues about docking, splitter, treeview and panels.
I read and tested, it worked perfectly fine.
I do not have words to say, but thank you, thank you, thank you ....a lot.
Jil.
Jil at 2007-9-9 >
