Hi Andy,
I think your understanding of out of bounds to change must be the comment
of InitializeCompo nent method:
" Required method for Designer support - do not modify
the contents of this method with the code editor."
This comment means that Microsoft suggests that you do not modify this code
section, but any changes to it will still take effect.
InitializeCompo nent method is created by the VS.NET designer and it is
associated with(reflect) the designer, so Microsoft suggests that you
change your control in the designer not in the code.(It is more safe and
convient at most time.)
For your problem, you also can get it down in the designer, but I think it
is more convinent to change the order of 2 sentences.
Does this answer your question?
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.
--------------------
| From: "Andy Bates" <An********@Ult imateSoftwareSo lutions.com>
| References: <#E************ **@TK2MSFTNGP10 .phx.gbl>
<u7************ **@cpmsftngxa06 .phx.gbl>
| Subject: Re: Adding ToolBar to an existing form...
| Date: Mon, 6 Oct 2003 06:40:55 +0100
| Lines: 79
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#E************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: cpc3-farn1-6-0-cust68.glfd.cab le.ntl.com 81.105.30.68
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1891 47
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Tom/Jeffrey -
|
| Thanks both solutions seem to work.
|
| Jeffrey - With regards to your suggestion, the fix is obviously applied to
| the InitializeCompo nent method, which as I understood it was out of bounds
| for changes, but it appears that this change has been retained; what
changes
| get kept and what get lost?!?
|
| Regards
|
| - Andy
|
| "Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
| news:u7******** ******@cpmsftng xa06.phx.gbl...
| >
| > Hi Andy,
| >
| > The late added control's Dock property will based on the early added
| > control, so when you add the toolbar control, it will base on the
| splitter.
| > In the code behind, this late-early base way was defined by the order
that
| > the control reference was added into the form's Controls collection.
| >
| > To get what you want, you need just move the statement
| > "this.Controls. Add(this.toolBa r1);" below all other controls' add
| > statement, then the toolbar's Dock will based on the form's edge.
| >
| > Hope this helps,
| > 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.
| >
| > --------------------
| > | From: "Andy Bates" <An********@Ult imateSoftwareSo lutions.com>
| > | Subject: Adding ToolBar to an existing form...
| > | Date: Sat, 4 Oct 2003 10:53:38 +0100
| > | Lines: 18
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#E************ **@TK2MSFTNGP10 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > | NNTP-Posting-Host: cpc3-farn1-6-0-cust68.glfd.cab le.ntl.com
81.105.30.68
| > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
| > | Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.langua ges.csharp:1889 34
| > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > |
| > | I have hopefully a simple problem in C#.
| > |
| > | I designed a form with a listview on left, vert splitter against that,
| > then
| > | the remainder of the form from top to bottom: a listview, horiz
splitter
| > and
| > | tab control (very similar to outlook express).
| > |
| > | I then started coding and realised that I needed to add a ToolBar.
When
| I
| > | added this, it didn't appear at the top as expected, but at the top of
| the
| > | tab control and I couldn't get it to appear where I wanted it to!
| > |
| > | Can anybody explain how to get the toolbar to the top of the form
| easily?
| > |
| > | TIA
| > |
| > | - Andy
| > |
| > |
| > |
| > |
| >
|
|
|