473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tab control "anchor"

I am using C# in Visual Studio.Net to create an
application. The problem I
am having is when the main form is moved around on the
screen, the "panel"
form that is displayed on the tab control does not move
with the main form.
How can I "anchor" them so they move together? I do not
want to put the
panels directly on the tab control, as I want to keep
them separate to allow
a more modular approach.

I have tried to make a main form that is a MdiContainer
(attempting to force
them to stay together), but have been unsuccessful at
making the "panel"
form show on top of the tab control. The MdiParent for
the "panel" form is
being set to the correct form, but when I use "Show"
and "BringToFront" on
the "panel" form, it gives me an error... " Cannot create
a child list for
field Contact." I am unable to locate where
the "Contact" field is that the
error is indicating. The tab control has a
ContactsTabPage, and displays
"Contacts" on the tab, but all fields have a different
naming convention so
a one word field like this does not exist. I am not
using menus in the
application in order to simplify the approach and would
like to stay with
the tab control.
Nov 15 '05 #1
3 12238

Hi,

Thanks for posting in this group.
Based on my understanding, you create a normal form whose parent form is
tabcontrol, and so you call it "panel" form.
But I can not reproduce your problem, I wrote a sample like this, set the
AnchorStyles for both the tabcontrol and the "panel" form.

private void Form1_Load(object sender, System.EventArgs e)
{
Form f=new Form();
f.TopLevel=false;
f.Parent=tabPage1;
f.Size=new Size(100,100);

f.Anchor=AnchorStyles.Bottom|AnchorStyles.Left|Anc horStyles.Right|AnchorStyl
es.Top;
f.Show();

tabControl1.Anchor=AnchorStyles.Bottom|AnchorStyle s.Left|AnchorStyles.Right|
AnchorStyles.Top;

}

If I misunderstand you, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #2
Using Visual Studio.Net and C#: I have created a layered
window with a
form(form1) that is anchored to a tab page of a tab
control. Form1 has one
panel with various controls on about one half of the
screen, and three group
boxes on the other side. It displays properly when not
anchored to the tab
page, however when the anchoring is added, the sizing
changes and form1 is
too wide to fit on the tab page client area. I have
added a form1.Size
assigning the form1 to the size that it should be,
however it has no effect.
When I reduce assignment to the form1.Size, the right
portion of the form1
is not visible. Vertical space does not appear to be a
problem. How do I
get the form1 to display properly when anchored to the
tab page?

The problem seems to be connected not to the form1.Anchor
but when the
form1.Parent is assigned. The form1.Dock works the same
way in that the
form1 becomes too large for the client rectangle.
Nov 15 '05 #3

Hi,

Based on my understanding, your layer form is too big, you want to change
it size, so that it can be fully shown in the tabpage. But the Form.size
setting does not take effect.
But I still can not reproduce your problem, in my original post, I also set
the form size, also set it anchor property. But it works well.
Can you explain your problem more clearly? Or you can provide a code
snippet to reproduce this problem.
If I misunderstand you , please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Romain | last post by:
Hi, I've used an excellent way to make target="_blank" links that still validate while using HTML 4.01 Transitional doctypes in the past. I learned the trick from :...
1
by: Frostillicus | last post by:
Does anyone know how to get around the problem IE seems to suffer from whereby an image within an anchor tag ignores the :hover pseudo element for the anchor in which it lives? Firefox is fine but...
19
by: Mason A. Clark | last post by:
How was I to know that "top" means "top" in MSIE6 ?? I was testing <a name="top"></a> at the top of the page with <a href="#top>go to top</a> at the bottom of the page. It always worked in...
3
by: hutch | last post by:
Hi, I'm making use of this VERY useful function for a so called 'standards compliant' replacement for target="_blank": function externalLinks() { if (!document.getElementsByTagName) return;...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
1
by: pbd22 | last post by:
Hi. I am trying to add an "onclick" 'event to an anchor tag and this is proving harder than I imagined. The anchor HAS NO ID. And, there will be tons of them on the page. So, I cannot access...
2
by: Chris Marsh | last post by:
All We have a requirement to add a "target" attribute with a value of "_parent" to any links in a given .aspx page, UNLESS a target has already been specified for that link. We are not in...
21
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to...
1
by: Patient Guy | last post by:
I have a "hidden" anchor in the body of a doc. By "hidden," I mean that the contained text of the anchor is indistinguishable from the surrounding text, the text contained by its parent/ancestor...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.