473,757 Members | 7,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding ToolBar to an existing form...

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

Nov 15 '05 #1
7 2358
Tom
Maybe you don't have the Z-order the way you want it. Try right clicking on
the Toolbar and selecting the "Send to Back" menu item. If that doesn't
take the toolbar to the top of the form, you probably sited it somewhere
other than on the form. I'd undock my other controls, move them down a bit,
then drag and drop (not cut and paste, or you may lose the toolbar contents)
the toolbar onto the main form.

Hope this helps.

Tom Clement
Apptero, Inc.

"Andy Bates" <An********@Ult imateSoftwareSo lutions.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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

Nov 15 '05 #2
Tom
Maybe you don't have the Z-order the way you want it. Try right clicking on
the Toolbar and selecting the "Send to Back" menu item. If that doesn't
take the toolbar to the top of the form, you probably sited it somewhere
other than on the form. I'd undock my other controls, move them down a bit,
then drag and drop (not cut and paste, or you may lose the toolbar contents)
the toolbar onto the main form.

Hope this helps.

Tom Clement
Apptero, Inc.

"Andy Bates" <An********@Ult imateSoftwareSo lutions.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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

Nov 15 '05 #3

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
|
|
|
|

Nov 15 '05 #4

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
|
|
|
|

Nov 15 '05 #5
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
|
|
|
|

Nov 15 '05 #6
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
|
|
|
|

Nov 15 '05 #7

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
| > |
| > |
| > |
| > |
| >
|
|
|

Nov 15 '05 #8

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

Similar topics

1
2458
by: Tony D. | last post by:
I could really use some help with a problem I am having. I am trying to add a new field to an existing form that combines two tables into one form. In this same databse I have another form that exists off of 1 table and when I add a new field into the table I have no problem adding into the corresponding form. However when I add a new field to one of the following tables: - Employee List & Main Profile tables (This is what the combined...
0
320
by: Andy Bates | last post by:
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...
2
1225
by: Steve McLellan | last post by:
Hi, Can anyone tell me how I can add an existing (managed) form into a project, and have it appear like others (i.e. able to open in the designer)? Thanks! Steve
1
1374
by: Wrauberto | last post by:
Howdy, I have an existing form loaded with all sorts of pretty boxes and buttons. I want to make this an MDI child and need to create an MDI parent OR make this a parent and launch children from it. I'll just say the files are: frmExistingForm frmNewMain frmNewChild
1
1105
by: Bill Nguyen | last post by:
I need to copy the existing form EDIT1 to EDIT2 into the same project so that I can modify EDIT2 while preserving EDIT1 for a slightly different use. What's an easy way to do it? Thanks Bill
3
2192
by: Byron Hopp | last post by:
Anybody have code to add a ToolBar, and its buttons to a MDI Child window. I have added the Toolbar, and added the buttons, but how do you determine what the button is going to execute upon the user clicking it. How do you add this code dynamically? Byron...
1
1308
by: ECathell | last post by:
I am getting an unspecified error when adding a windows form to a project. New project, old project. Doesn't matter. Also happens for user control. All the message box says is Unspecified Error. -- --Eric Cathell, MCSA
7
1928
by: ewarts | last post by:
Hello all, I'm having an issue adding more combo box to an existing form, please correct me if I'm wrong in my method but i'm copying the combo box above and pasting it below so to have the same format as the others and to minimize my efforts. The form has a subform so i'm creating the same for that form also but after all is said and done it doen not display on the main form. What am I doing wrong. ED
2
8174
by: mhnaccess | last post by:
I am trying to create controls, EG a text box, at runtime. ALL examples I find are creating a new form at the same time. I want to create a control on an existing form. The following does not work: Dim frm As Form Dim Box_1 As Control Set Box_1 = CreateControl(frm.Name, acRectangle) With Box_1 .Width = 100 .Height = 100
0
10072
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.