Beruflich Dokumente
Kultur Dokumente
Trademarks The ComponentOne product name is a trademark and ComponentOne is a registered trademark of ComponentOne LLC. All other trademarks used herein are the properties of their respective owners. Warranty ComponentOne warrants that the original CD (or diskettes) are free from defects in material and workmanship, assuming normal use, for a period of 90 days from the date of purchase. If a defect occurs during this time, you may return the defective CD (or disk) to ComponentOne, along with a dated proof of purchase, and ComponentOne will replace it at no charge. After 90 days, you can obtain a replacement for a defective CD (or disk) by sending it and a check for $25 (to cover postage and handling) to ComponentOne. Except for the express warranty of the original CD (or disks) set forth here, ComponentOne makes no other warranties, express or implied. Every attempt has been made to ensure that the information contained in this manual is correct as of the time it was written. We are not responsible for any errors or omissions. ComponentOnes liability is limited to the amount you paid for the product. ComponentOne is not liable for any special, consequential, or other damages for any reason. Copying and Distribution While you are welcome to make backup copies of the software for your own use and protection, you are not permitted to make copies for the use of anyone else. We put a lot of time and effort into creating this product, and we appreciate your support in seeing that it is used by licensed users only. This manual was produced using ComponentOne Doc-To-Help.
Table of Contents
ComponentOne SplitContainer for WinForms Overview ............................................................... 5 Installing SplitContainer for WinForms .................................................................................................... 5 SplitContainer for WinForms Setup Files ................................................................................................. 5 System Requirements ............................................................................................................................... 6 Installing Demonstration Versions ............................................................................................................ 6 Uninstalling SplitContainer for WinForms ............................................................................................... 6 End-User License Agreement ................................................................................................................... 7 Licensing FAQs ....................................................................................................................................... 7 What is Licensing? ................................................................................................................................... 7 How does Licensing Work? ...................................................................................................................... 7 Common Scenarios .................................................................................................................................. 8 Common Scenarios in Mobile Applications ............................................................................................ 10 Troubleshooting ..................................................................................................................................... 11 Technical Support .................................................................................................................................. 12 Redistributable Files ............................................................................................................................... 13 About This Documentation .................................................................................................................... 13 Namespaces ........................................................................................................................................... 14 Creating a .NET Project ......................................................................................................................... 15 Adding the C1SplitContainer Component to a Project ............................................................................ 16 Key Features.......................................................................................................................19 SplitContainer for WinForms Quick Start .................................................................................20 Step 1 of 4: Adding C1SplitContainer to the Page .................................................................................. 20 Step 2 of 4: Adding C1SplitterPanels to the C1SplitContainer ................................................................. 21 Step 3 of 4: Creating Collapsible Panels .................................................................................................. 22 Step 4 of 4: Sizing the C1SplitContainer Control.................................................................................... 24 Design-Time Support ............................................................................................................24 C1SplitContainer Smart Tags ................................................................................................................. 25 C1SplitContainer Tasks Menu ................................................................................................................ 25 C1Splitter Panel Tasks Menu.................................................................................................................. 26 SplitContainer Elements........................................................................................................27 Splitter Panels ........................................................................................................................................ 27 Panel Header.......................................................................................................................................... 28 Splitter Bar ............................................................................................................................................. 29 Expander Button .................................................................................................................................... 29 SplitContainer Appearance ....................................................................................................30 SplitContainer Visual Styles ................................................................................................................... 30 SplitContainer Appearance Properties .................................................................................................... 32 SplitContainer Layout ..........................................................................................................33 SplitContainer Layout Options ............................................................................................................... 34 Horizontal Split ...................................................................................................................................... 35 Vertical Split .......................................................................................................................................... 35 Compound Split ..................................................................................................................................... 36 Full-Size Split ......................................................................................................................................... 36 SplitterPanel Behavior ..........................................................................................................37 Collapsible and Expandable Panels ........................................................................................................ 37 SplitterPanel Scrolling ............................................................................................................................ 38 SplitterPanel and Splitter Bar Sizing ....................................................................................................... 38
iii
OwnerDraw Panel Header and Splitter ................................................................................................... 39 SplitContainer for WinForms Samples .....................................................................................39 SplitContainer for WinForms Task-Based Help ..........................................................................41 Adding Content to the Splitter Panels ..................................................................................................... 41 Adding Arbitrary Controls to the C1SplitterPanel ................................................................................... 41 Adding Text to a Splitter Panel ............................................................................................................... 43 Adding Multiple Panels to the C1SplitContainer .................................................................................... 45 Changing the C1SplitContainers Appearance ........................................................................................ 47 Changing the Background Color of Panels .............................................................................................. 47 Changing the Border Color ..................................................................................................................... 49 Changing the Visual Style ....................................................................................................................... 51 Changing the Splitter Width ................................................................................................................... 52 Creating Different Split Types ................................................................................................................ 54 Creating a Horizontal Split ..................................................................................................................... 54 Creating a Vertical Split .......................................................................................................................... 56 Creating a Nested Split ........................................................................................................................... 58 Creating a Full-Size Split ........................................................................................................................ 58 Setting C1SplitContainer Behaviors ........................................................................................................ 60 Adding a ToolTip to the Collapsed Splitter Panel ................................................................................... 60 Setting a Minimum Size for a Splitter Panel ............................................................................................ 61 Setting a Collapsible Splitter Panel ......................................................................................................... 62
iv
- SplitContainer for WinForms Quick Start (page 20) - SplitContainer Layout (page 33) - SplitContainer for WinForms Task-Based Help (page 41)
bin C1SplitContainer
The ComponentOne Studio for WinForms Help Setup program installs integrated Microsoft Help Viewer help to the C:\Program Files\ComponentOne\Studio for WinForms\HelpViewer folder. Samples Samples for the product are installed in the ComponentOne Samples folder by default. The path of the ComponentOne Samples directory is slightly different on Windows XP and Windows Vista machines: Windows XP path: C:\Documents and Settings\<username>\My Documents\ComponentOne Samples
Windows Vista path: C:\Users\<username>\Documents\ComponentOne Samples The ComponentOne Samples folder contains the following subdirectories: Contains support and data files that are used by many of the demo programs. Contains samples and tutorials for SplitContainer for WinForms.
Common C1SplitContainer
Samples can be accessed from the ComponentOne Sample Explorer. On your desktop, click the Start button and then click ComponentOne | Studio for WinForms| Samples |SplitContainer Samples.
System Requirements
System requirements include the following: Windows 7 Windows 2000 Windows Server 2003 Windows Server 2008 Windows XP SP2 Windows Vista Environments: .NET Framework 2.0 or later C# .NET Visual Basic .NET Disc Drive: CD or DVD-ROM drive if installing from CD
Operating Systems:
Licensing FAQs
This section describes the main technical aspects of licensing. It may help the user to understand and resolve licensing problems he may experience when using ComponentOne .NET and ASP.NET products.
What is Licensing?
Licensing is a mechanism used to protect intellectual property by ensuring that users are authorized to use software products. Licensing is not only used to prevent illegal distribution of software products. Many software vendors, including ComponentOne, use licensing to allow potential users to test products before they decide to purchase them. Without licensing, this type of distribution would not be practical for the vendor or convenient for the user. Vendors would either have to distribute evaluation software with limited functionality, or shift the burden of managing software licenses to customers, who could easily forget that the software being used is an evaluation version and has not been purchased.
When a user decides to purchase a product, he receives an installation program and a Serial Number. During the installation process, the user is prompted for the serial number that is saved on the system. (Users can also enter the serial number by clicking the License button on the About Box of any ComponentOne product, if available, or by rerunning the installation and entering the serial number in the licensing dialog.) When a licensed component is added to a form or web page, Visual Studio obtains version and licensing information from the newly created component. When queried by Visual Studio, the component looks for licensing information stored in the system and generates a run-time license and version information, which Visual Studio saves in the following two files: An assembly resource file which contains the actual run-time license A "licenses.licx" file that contains the licensed component strong name and version information These files are automatically added to the project by Microsoft Visual Studio. In WinForms and ASP.NET 1.x applications, the run-time license is stored as an embedded resource in the assembly hosting the component or control by Visual Studio. In ASP.NET 2.x applications, the run-time license may also be stored as an embedded resource in the App_Licenses.dll assembly, which is used to store all run-time licenses for all components directly hosted by WebForms in the application. Thus, the App_licenses.dll must always be deployed with the application. The licenses.licx file is a simple text file that contains strong names and version information for each of the licensed components used in the application. Whenever Visual Studio is called upon to rebuild the application resources, this file is read and used as a list of components to query for run-time licenses to be embedded in the appropriate assembly resource. Note that editing or adding an appropriate line to this file can force Visual Studio to add run-time licenses of other controls as well.
Note that the licenses.licx file is usually not shown in the Solution Explorer; it appears if you press the Show All Files button in the Solution Explorer's toolbox, or from Visual Studio's main menu, select Show All Files on the Project menu. Later, when the component is created at run time, it obtains the run-time license from the appropriate assembly resource that was created at design time and can decide whether to simply accept the run-time license, to throw an exception and fail altogether, or to display some information reminding the user that the software has not been licensed. All ComponentOne products are designed to display licensing information if the product is not licensed. None will throw licensing exceptions and prevent applications from running.
Common Scenarios
The following topics describe some of the licensing scenarios you may encounter.
Please note, that C1 licensing will not accept a run time license for a derived control if the run time license is embedded in the same assembly as the derived class definition, and the assembly is a DLL. This restriction is necessary to prevent a derived control class assembly from being used in other applications without a design time license. If you create such an assembly, you will need to take one of the actions previously described create a component at run time.
6.
Note that the AssemblyConfiguration string may contain additional text before or after the given string, so the AssemblyConfiguration attribute can be used for other purposes as well. For example: [AssemblyConfiguration("C1CheckForDesignLicenseAtRuntime,BetaVersion")] THIS METHOD SHOULD ONLY BE USED UNDER THE SCENARIO DESCRIBED. It requires a design time license to be installed on the testing machine. Distributing or installing the license on other computers is a violation of the EULA.
There are cases where the setup may not prompt you. If you have a valid license installed already, or if you are installing a version of the controls that has already been installed (Maintenance Mode), you will not be prompted to enter your serial number. If you need to enter your serial number for an install, and the install is running in Maintenance Mode, you will need to uninstall first. Once you uninstall, run the install again. If you are still not prompted for a serial number by the time you get to the install screen, you must have a valid license in the registry on your machine. If you still need to install a new serial number, remove the old license and then run the setup again. There is a utility available that will remove the old license for you, which can be found below. License Remover The license remover will search for the following licenses on your system: Studio Enterprise, Studio for Mobile Devices, and individual Studio Mobile product licenses. Any licenses that are found will be populated into a list so that you can select the ones that you would like to remove. To remove a Studio for Mobile Devices license with the license remover, follow these steps: 1. 2. Unzip and run the C1LicBomb.exe. You will see an app with a list of the installed licenses on your machine. If you see both Studio Enterprise and Studio for Mobile devices listed, select both for removal, otherwise select the one that you see. If the new serial number that you wish to enter for Studio for Mobile Devices is not a Studio Enterprise serial number, you will need to enter your Studio Enterprise serial number again, but this can be done through any of the About Boxes for C1 controls with the exception of the Mobile Studio About Boxes. Select any other licenses you wish to remove, then click the Remove Selected Licenses button. You will be asked if you are sure that you want to delete each key; click OK when you get the dialog box.
3. 4.
10
5. 6.
There will also be a dialog box to let you know that a particular key was removed successfully; click OK for that one also. Now you can close the program and run your Studio for Mobile Devices setup again to enter your new serial number.
Follow through with the setup, enter your serial number when prompted, and ComponentOne Studio for Mobile Devices will be licensed on your machine.
Troubleshooting
We try very hard to make the licensing mechanism as unobtrusive as possible, but problems may occur for a number of reasons. Below is a description of the most common problems and their solutions.
I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.
If this happens, there may be a problem with the licenses.licx file in the project. It either doesn't exist, contains wrong information, or is not configured correctly. First, try a full rebuild (Rebuild All from the Visual Studio Build menu). This will usually rebuild the correct licensing resources. If that fails follow these steps: 1. 2. 3. 4. Open the project and go to the Solution Explorer window. Click the Show All Files button on the top of the window. Find the licenses.licx file and open it. If prompted, continue to open the file. Change the version number of each component to the appropriate value. If the component does not appear in the file, obtain the appropriate data from another licenses.licx file or follow the alternate procedure following. Save the file, then close the licenses.licx tab. Rebuild the project using the Rebuild All option (not just Rebuild). Open the project and go to the Solution Explorer window. Click the Show All Files button on the top of the window.
5. 6. 1. 2.
11
3. 4. 5. 6. 7. 1. 2. 3. 4.
Find the licenses.licx file and delete it. Close the project and reopen it. Open the main form and add an instance of each licensed control. Check the Solution Explorer window, there should be a licenses.licx file there. Rebuild the project using the Rebuild All option (not just Rebuild). Open the project and go to the Solution Explorer window. Find the licenses.licx file and right-click it. Select the Rebuild Licenses option (this will rebuild the App_Licenses.licx file). Rebuild the project using the Rebuild All option (not just Rebuild).
I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.
There is no need to install any licenses on machines used as servers and not used for development. The components must be licensed on the development machine, therefore the licensing information will be saved into the executable (.exe or .dll) when the project is built. After that, the application can be deployed on any machine, including web servers. For ASP.NET 2.x applications, be sure that the App_Licenses.dll assembly created during development of the application is deployed to the bin application bin directory on the web server. If your ASP.NET application uses WinForms user controls with constituent licensed controls, the runtime license is embedded in the WinForms user control assembly. In this case, you must be sure to rebuild and update the user control whenever the licensed embedded controls are updated.
I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.
Make sure that the serial number is still valid. If you licensed the component over a year ago, your subscription may have expired. In this case, you have two options: Option 1 - Renew your subscription to get a new serial number. If you choose this option, you will receive a new serial number that you can use to license the new components (from the installation utility or directly from the About Box). The new subscription will entitle you to a full year of upgrades and to download the latest maintenance builds directly from http://prerelease.componentone.com/. Option 2 Continue to use the components you have. Subscriptions expire, products do not. You can continue to use the components you received or downloaded while your subscription was valid.
Technical Support
ComponentOne offers various support options. For a complete list and a description of each, visit the ComponentOne Web site at http://www.componentone.com/SuperProducts/SupportServices/. Some methods for obtaining technical support include: Online Resources
12
ComponentOne provides customers with a comprehensive set of technical resources in the form of FAQs, samples and videos, Version Release History, searchable Knowledge base, searchable Online Help and more. We recommend this as the first place to look for answers to your technical questions. Online Support via our Incident Submission Form This online support service provides you with direct access to our Technical Support staff via an online incident submission form. When you submit an incident, you'll immediately receive a response via e-mail confirming that you've successfully created an incident. This e-mail will provide you with an Issue Reference ID and will provide you with a set of possible answers to your question from our Knowledgebase. You will receive a response from one of the ComponentOne staff members via e-mail in 2 business days or less. Product Forums ComponentOnes product forums are available for users to share information, tips, and techniques regarding ComponentOne products. ComponentOne developers will be available on the forums to share insider tips and technique and answer users questions. Please note that a ComponentOne User Account is required to participate in the ComponentOne Product Forums. Installation Issues Registered users can obtain help with problems installing ComponentOne products. Contact technical support by using the online incident submission form or by phone (412.681.4738). Please note that this does not include issues related to distributing a product to end-users in an application. Documentation Microsoft integrated ComponentOne documentation can be installed with each of our products, and documentation is also available online. If you have suggestions on how we can improve our documentation, please email the Documentation team. Please note that e-mail sent to the Documentation team is for documentation feedback only. Technical Support and Sales issues should be sent directly to their respective departments.
Note: You must create a ComponentOne Account and register your product with a valid serial number to obtain support using some of the above methods.
Redistributable Files
ComponentOne SplitContainer for WinForms is developed and published by ComponentOne LLC. You may use it to develop applications in conjunction with Microsoft Visual Studio or any other programming environment that enables the user to use and integrate the control(s). You may also distribute, free of royalties, the following Redistributable Files with any such application you develop to the extent that they are used separately on a single CPU on the client/workstation side of the network: C1.Win.C1SplitContainer.4.dll C1.Win.C1SplitContainer.4.Design.dll
Site licenses are available for groups of multiple developers. Please contact Sales@ComponentOne.com for details.
13
Corporate Headquarters ComponentOne LLC 201 South Highland Avenue 3rd Floor Pittsburgh, PA 15206 USA 412.681.4343 412.681.4384 (Fax) http://www.componentone.com ComponentOne Doc-To-Help This documentation was produced using ComponentOne Doc-To-Help Enterprise.
Namespaces
Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries. The general namespace for ComponentOne Windows products is C1.Win. The general namespace for ComponentOne Web-based products is C1.Web. The namespace for the C1SplitContainer control is C1.Win.C1SplitContainer. The following code fragment shows how to declare a C1SplitContainer control using the fully qualified name for this class: Visual Basic Dim splitcontainer As C1.Win.C1SplitContainer.C1SplitContainer C# C1.Win.C1SplitContainer.C1SplitContainer splitcontainer;
Namespaces address a problem sometimes known as namespace pollution, in which the developer of a class library is hampered by the use of similar names in another library. These conflicts with existing components are sometimes called name collisions. For example, if a new class named C1SplitterPanel is created, it can be used inside the project without qualification. However, the C1SplitContainer assembly also implements a class called C1SplitterPanel. So, if the C1SplitterPanel class will be used in the same project, a fully qualified reference must be used to make the reference unique. If the reference is not unique, Visual Studio .NET produces an error stating that the name is ambiguous. Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined. Objects defined in other projects can be used if a reference to the class is created (by choosing Add Reference from the Project menu) and then using the fully qualified name for the object in the code. Fully qualified names prevent naming conflicts because the compiler can always determine which object is being used. However, the names themselves can get long and cumbersome. To get around this, you can use the Imports statement (using in C#) to define an alias an abbreviated name you can use in place of a fully qualified name. For example, the following code snippet creates aliases for two fully qualified names, and uses these aliases to define two objects: Visual Basic Imports C1SplitterPanel = C1.Win.C1SplitContainer.C1SplitterPanel Imports MySplitterPanel = C1.Win.C1SplitContainer.C1SplitterPanel Dim SP1 As C1SplitterPanel Dim SP2 As C1SplitterPanel
14
C# using C1SplitterPanel = C1.Win.C1SplitContainer.C1SplitterPanel; using MySplitterPanel = C1.Win.C1SplitContainer.C1SplitterPnalel; C1SplitterPanel SP1; MySplitterPanel SP2;
If the Imports statement is used without an alias, use all the names in that namespace without qualification provided they are unique to the project. As a warning, unless specified explicitly in the code, it is taken for granted that the following statement has been specified: Visual Basic Imports C1.Win.C1SplitContainer C# using C1.Win.C1SplitContainer;
This applies only to small code samples. Tutorials and other longer samples will specify complete qualifiers.
4.
Enter or browse for a location for your application in the Location field and click OK.
A new Microsoft Visual Studio .NET project is created in the specified location. In addition, a new Form1 is displayed in the Designer view. 5. Double-click the C1SplitContainer component from the Toolbox to add it to Form1. For information on adding a component to the toolbox, see Adding the C1SplitContainer Component to a Project.
15
3. 4.
Right-click the tab where the component is to appear and select Choose Items from the context menu. The Choose Toolbox Items dialog box opens. In the dialog box, select the .NET Framework Components tab. Sort the list by Namespace (click the Namespace column header) and check the check boxes for all components belonging to namespace C1.Win.C1SplitContainer. Note that there may be more than one component for each namespace.
16
Adding C1SplitContainer to the Form To add C1SplitContainer to a form: 1. 2. Add the C1SplitContainer control to the Visual Studio Toolbox. Double-click the control or drag it onto your form.
Adding a Reference to the Assembly To add a reference to the C1SplitContainer assembly: 1. 3. 4. Select the Add Reference option from the Project menu of your project. Select the ComponentOne C1SplitContainer assembly from the list on the .NET tab or browse to find the C1.Win.C1SplitContainer.4.dll file and click OK. Double-click the form caption area to open the code window. At the top of the file, add the following Imports statements (using in C#): Imports C1.Win.C1SplitContainer
Note: This makes the objects defined in the C1SplitContainer assembly visible to the project. See Namespaces for more information.
17
Key Features
The following are some of the main features of C1SplitContainer that you may find useful: Expand and Collapse Panels Just set one property, Collapsible, to enable expandable or collapsible panels. See Collapsible and Expandable Panels (page 37) for more information.
Flexible Layout Options With just one property, Dock, you can create a complex interface by docking panels or nested panels to the top, bottom, left, or right of the container control. For more information see SplitContainer Layout (page 33).
Multiple Panels You can easily add, remove, and modify multiple panels through the C1SplitContainer.Panels Collection editor. For more information see Adding Multiple Panels to the C1SplitContainer (page 45).
Unlimited Nesting Organize massive amounts of data into one page using SplitContainers nesting feature. SplitContainer for WinForms enables you to nest multiple splits of any orientation type as well accommodate the resizing for the nested splitters when you resize the panel. See Compound Split (page 36) for more information.
Collapsed or Expanded Splitter Bar ToolTip Create a more user-friendly Windows application by adding a ToolTip to the collapsed or expanded splitter bar. The ToolTip can let end-users know to click on the expander button to expand the hidden panel or click on the collapsed button to hide the panel. See Expander Button (page 29) for more information.
19
In the next step, you will add several C1SplitterPanels to the C1SplitContainer control.
20
4. 5. 6.
Select C1SplitContainer2 and click Add Panel from its tasks menu to add a new C1SplitterPanel. Select C1SplitContainer1 and click Add Panel from its tasks menu to add a new C1SplitterPanel. Select C1SplitContainer1 Panel1 dock property to left.
7.
21
Panel2 which contains Panel1 and Panel2 of C1SplitContainer2 will be docked to the left of its parent control, Panel 3.
22
The expander button appears and now you will be able to expand or collapse the panels of Panel 2 at run time. 2. Select C1SplitContainer1 to reveal its list of properties and then complete the following: 3. 4. 5. Set the C1SplitContainer1.BackColor property to LightSteelBlue. Set the C1SplitContainer1.FixedLineColor property to BlanchedAlmond. Set the C1SplitContainer1.HeaderBackColor property to Navy. Set the C1SplitContainer1.HeaderForeColor property to White. Set the C1SplitContainer1.SplitterColor property to BlanchedAlmond.
For more information see SplitContainer Appearance Properties (page 32). Set the C1SplitContainer1.Dock property to Fill. Select C1SplitContainer1 and click Edit Panels from its tasks menu. In the Members list select the c1SplitterPanel2 [Panel 2] and delete the default, Panel 2 text from the Text property. This removes the panel header from the C1SplitContainer. The appearance settings will be updated at design time, and your control will resemble the following image:
In the next step, you'll control the sizing for the C1SplitterPanels.
23
Select c1SplitterPanel4 of the C1SplitContainer1 and set its the c1SplitterPanel4.MinWidth property to 80. Press F5 to build the project. Observe the following behaviors: Hover over the expander button and notice that a tooltip appears with the default text, minimize panel 1. Click the expander button and notice panel1 collapses. Notice how you cant resize the Fixed panel since you set the Resizable property to False. Click the splitter bar to activate it and then attempt to drag the splitter bar to the bottom of the control.
As you've probably noticed by now and as you can see in the image above you can't expand the bar all the way over to the right of the control. This is because you set the MinWidth to 80 so that users wouldn't be able to minimize Panel 3 to a width of less than 80 pixels. Thus, upon releasing your cursor, Panel 3 will appear no smaller than 80 pixels. What You've Accomplished Congratulations! You have successfully completed the C1SplitContainer quick start. In this topic, you added a C1SplitContainer control to your window page, added panels, customized its behavior and appearance, and manipulated the control at run time.
Design-Time Support
C1SplitContainer provides customized context menus, smart tags, and a designer that offers rich design-time support and simplifies working with the object model.
24
The following topics describe how to use C1SplitContainer design-time environment to configure C1SplitContainer.
The C1SplitContainer Tasks menu operates as follows: Add Panel Clicking the Add Panel item adds a new C1SplitterPanel beneath the existing one. Edit Panels Clicking the Edit Panels item opens the C1SplitContainer.Panels Collection Editor where you can add, remove, or modify C1SplitterPanels. Visual Style The Visual Style dropdown box provides a list of styles to choose from: Custom, System, Office2007Black, Office2007Blue, Office2007Silver, Office2010Black, Office2010Blue, Office2010Silver, and Windows7. Splitter Width Specifies the width of the splitter element. The default splitter width is 4 pixels. Splitter Color Click the dropdown arrow and select a color to specify the background color for the splitter element.
25
Fixed Line Color Click the dropdown arrow and select a color to specify the fixed line background color for the C1SplitContainer. Border Width Specifies the width of the C1SplitContainer border, in pixels. The default Border width is 1 pixel. Header Height Specifies the height of each C1SplitterPanel header. The default height is 21 pixels. Line Below Header Unchecking the checkbox removes the line below the header item. About C1SplitContainer Clicking About C1SplitContainer reveals the About ComponentOne dialog box. This dialog box displays the version number and licensing information for the ComponentOne SplitContainer product.
The C1SplitterPanel Tasks menu operates as follows: Text Specifies the name that appears in the Header element of the C1SplitterPanel. Text Align Click on the dropdown arrow to specify the alignment of the header text: Left, Center, and Right. Dock Click on the dropdown arrow to specify the dock position of the C1SplitterPanel: Top, Bottom, Left, or Right. Keep Relative Size Unchecking this checkbox sets the KeepRelativeSize property to False. Resizable Unchecking this checkbox sets the Resizable property to False. If set to False, the panel will not be resized with a splitter.
26
Resize While Dragging Splitter Indicates whether or not to resize the panel while the user is dragging the splitter. By default the checkbox is unchecked so the user cant resize the panel while dragging the splitter. Collapsible Indicates whether or not the C1SplitterPanel can be collapsed. Check this checkbox to make the C1SplitterPanel collapsible. By default the panel is not collapsible.
SplitContainer Elements
The topics in this section are categorized into distinct elements that represent different aspects of the C1SplitContainer control. Each individual topic provides the following information: The elements purpose and its position within a control. The elements essential parts. The elements properties that affect the appearance and functionality of the element.
Four elements exist within the C1SplitContainer control: a C1SplitterPanel, Splitter Bar, SplitterPanel Header, and an expander button. The C1SplitContainer represents a container to hold the panels and its elements. The Splitter Bar represents the divider that separates the two panels. The C1SplitterPanel represents the panel inside the C1SplitContainer. The Panel Header represents the header that appears as a rectangular title bar above each panel. By default, a fixed line appears below the panel header and its color and width can be controlled by the FixedLineColor and FixedLineWidth properties. The expander button appears when the Collapsible property is true. The following image labels the elements of the C1SplitContainer control:
Splitter Panels
The default C1SplitContainer has 1 panel. One or more panels can be added to the C1SplitContainer at design time through the C1SplitContainers Tasks menu or properties window or programmatically through the Add method. When a second panel is added it appears below the previous panel and a horizontal splitter bar separates the two panels.
27
Arbitrary controls can be added within each panel. In the C1SplitContainer.Panels Collection editor, you can add, remove, and edit each panel's appearance and behavior through the C1SplitterPanel properties included in it. In the object model for C1SplitContainer, all panels are referred as the C1SplitterPanel. The C1SplitterPanel object contains properties and methods for all panels. You can apply different behaviors and styles to each panel since you can set each panel individually.
Panel Header
The Panel Header represents the header that appears as a rectangular title bar above each panel. By default, a fixed line appears below the panel header and its color and width can be controlled by the FixedLineColor and FixedLineWidth properties. A panel header can be removed by deleting the text from the Text property. The following table lists and describes the properties that effect the panel header:
Property HeaderBackColor HeaderForeColor HeaderTextAlign Text FixedLineColor FixedLineWidth LineBelowHeader HeaderHeight HeaderTextOffset Description Gets the background color of the header in the C1SplitterPanel. Gets the foreground color of the header in the C1SplitterPanel. Gets the text alignment for the header in the C1SplitterPanel. Gets the text for the header in the C1SplitterPanel. Gets or sets the color of a fixed dividing line. Gets or sets the width of a fixed dividing line. Gets or sets whether a horizontal line should appear below panel headers. Gets or sets the height of the C1SplitterPanel header. Gets or sets the offset value (in pixels) of the panel caption text.
28
Splitter Bar
The Splitter Bar represents the divider that separates the two panels. The splitter bar appears when two or more panels are added to the C1SplitContainer control. The following table lists and describes the properties that effect the splitter bar:
Property SplitterColor SplitterWidth SplitterMovingColor SplitterMovingOpacity Description Gets or sets the color of a splitter element. Gets or sets the width of a splitter element. Gets or sets the opacity level of a splitter being moved by the user. Gets or sets the opacity level of a splitter being moved by the user.
Expander Button
The expander button appears on the splitter bar of the C1SplitContainer when the Collapsible property is True. When the panel is expanded the arrow points up and when the panel is collapsed the arrow points down. You can make the expander button appear larger by setting the EnlargeCollapsingHandle property to True. The expander button image and the splitter bar will appear different depending on the visual style applied to the control. Appearance of the Splitter Bar Styles The following image illustrates the Collapsible property set to True:
The following image illustrates the Collapsible property set to True and the EnlargeCollapsingHandle property set to True:
29
SplitContainer Appearance
The following topics describe C1SplitContainers built-in visual styles and appearance properties.
Office2007Black
30
Office2007Blue
Office2007Silver
Office2010Black
Office2010Blue
31
Office2010Silver
Windows7
The following table describes each of the C1SplitContainer appearance properties used in the image above:
32
Property
Description Gets the background color of the C1SplitContainer control. Gets the width of the splitter element. Gets the color of the splitter element. Gets the color of the fixed dividing line. Gets the width of the fixed dividing line.
C1SplitContainer.BackColor
SplitterWidth SplitterColor FixedLineColor FixedLineWidth
The following table describes each of the C1SplitterPanel appearance properties used in the image above:
Property HeaderBackColor HeaderForeColor HeaderTextAlign Text Description Gets the background color of the header in the C1SplitterPanel. Gets the forecolor of the header in the C1SplitterPanel. Gets the text alignment for the header in the C1SplitterPanel. Gets the text for the header in the C1SplitterPanel.
For task-based help on modifying the C1SplitterPanels appearance, see Changing the C1SplitContainers Appearance (page 47).
SplitContainer Layout
C1SplitContainer has a WYSIWYG editor that allows you to view the end result without having to run the project. With the WYSIWYG designer interface C1SplitContainer supports, it makes it simple to arrange child controls in the containers of the panels because C1SplitContainer displays them as it would at run time. You can add as many child controls to each panel by dragging and dropping each control into the desired panel. Panels can be selected on the Form by clicking anywhere inside the rectangular box. The WYSIWYG designer interface makes it simple to add child controls to a specific splitter panel via drag and drop. You also can add child controls programmatically to a specific splitter panel through the C1SplitterPanel object since it is a control. To add a C1SplitterPanel programmatically to a specified panel, use the following code: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add panel1 to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2)
33
Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); Controls.Add(split); } For more information on adding multiple panels to the C1SplitContainer see, Adding Multiple Panels to the C1SplitContainer (page 45).
The C1SplitterPanels layout can easily be controlled by the Dock property. The C1SplitterPanels can be docked to the top, left, right or bottom on the container that the C1SplitterPanel has been assigned to. Use the Dock property to define how a C1SplitterPanel is automatically resized as its parent control is resized. For example, setting the Dock to Left causes the panel to align itself with the left edges of its parent control and to resize as the parent control is resized. If Left, Right, Top, or Bottom is selected, the specified and opposite edges of the control are resized to the size of the containing C1SplitContainer's corresponding edges. The PanelDockStyle settings are:
Member Name Description The C1SplitterPanels top edge is docked to the top of its containing C1SplitContainer. The C1SplitterPanels bottom edge is docked to the
Top Bottom
34
Left Right
The C1SplitterPanels left edge is docked to the left edge of its containing C1SplitContainer. The C1SplitterPanels right edge is docked to the right edge of its containing C1SplitContainer.
The last visible panel in the Panels collection is the special case. It always behaves as if its Dock property is set to Fill (all four sides of the control are resized to match the containing controls edges). Values of the following properties are ignored for the last visible panel: Collapsible, ResizeWhileDragging, Dock, SizeRatio, KeepRelativeSize, and Resizable. Also, an attempt to change the Width or the Height property of such a panel has no visible effect. If this panel becomes not the last, or if any of the subsequent panels becomes visible, all the mentioned properties start to work as one may expect. C1SplitterPanels Dock property makes it easy to create the following splits in the C1SplitContainer: Horizontal Split Vertical Split Nested Split Full Split
Horizontal Split
A horizontal split is the default split type for the C1SplitContainer. It divides the panels into two or more rows and is represented in the windows page by one or more splitter bars. In a horizontal split the panels are both docked to the top. The following image illustrates a horizontal split:
For task-based help on creating a horizontal split, see Creating a Horizontal Split (page 54).
Vertical Split
A vertical split divides the panels into two or more columns and is represented in the Window page by one or more splitter bars. The following image illustrates a vertical split:
35
For task-based help on creating a vertical split, see Creating a Vertical Split (page 56).
Compound Split
A compound split is a nested split, meaning that the initial C1SplitContainer control contains one or more C1SplitContainer controls. A compound split can contain two or more vertical splitters, two or more horizontal splitters, or a combination of vertical and horizontal splitters. A compound split can be created by added two or more C1SplitterPanels into the panel of the parent C1SplitContainer. For more information on creating a compound split, see Creating a Nested Split (page 58). The following image illustrates a compound split:
For task-based help on creating a compound split, see Creating a Nested Split (page 58).
Full-Size Split
A full-size split is a horizontal or vertical split that stretches to fill the content area of a window. The following image illustrates a full-size split:
36
To create a full-size split, set the C1SplitContainer.Dock property to Fill. For task-based help on creating a fullsize split, see Creating a Full-Size Split (page 58).
SplitterPanel Behavior
The following section details the behavior properties used to control the behavior of the splitter panels.
When the Collapsible property is set to True you can enter text for the collapsed or collapsing tooltip using the CollapsedToolTip and CollapsingToolTip properties. The following image shows the default tooltip when you hover over the expanded button:
37
When you hover over the expander button of a minimized panel the default tooltip text will read, expand panel.
SplitterPanel Scrolling
The panels in the C1SplitContainer control are scrollable by default.
38
39
3.
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) ' Create a Button control and add text to it Dim button1 As New Button() button1.Text = "Hello World!"
41
' Create a TextBox control Dim textbox1 As New TextBox() 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add panel1 to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" 'add the splitcontainer Controls.Add(split) 'add the button control to panel1 panel1.Controls.Add(button1) 'add the textbox control to panel2 panel2.Controls.Add(textbox1) End Sub C# private void Form1_Load(object sender, EventArgs e) { // Create a Button control and add text to it Button button1 = new Button(); button1.Text = "Hello World!"; // Create a TextBox control TextBox textbox1 = new TextBox(); //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //add the splitcontainer Controls.Add(split); //add the button control to panel1
42
panel1.Controls.Add(button1); //add the textbox control to panel2 panel2.Controls.Add(textbox1); } 4. Run the program.
This Topic Illustrates the Following: The following graphic depicts a C1SplitContainer control with a Button control in Panel1 and a TextBox control in Panel2.
43
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) Dim richtextbox1 As New RichTextBox() richtextbox1.Text = "A lighthouse is a building to help aid pilots in navigation while at sea or on inland waterways." richtextbox1.ForeColor = Color.DarkBlue richtextbox1.Dock = DockStyle.Fill 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add panel1 to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" 'add the splitcontainer Controls.Add(split) 'add the button control to panel1 panel1.Controls.Add(richtextbox1) End Sub C# private void Form1_Load(object sender, EventArgs e) { RichTextBox richtextbox1 = new RichTextBox(); richtextbox1.Text = "A lighthouse is a building to help aid pilots in navigation while at sea or on inland waterways."; richtextbox1.ForeColor = Color.DarkBlue; richtextbox1.Dock = DockStyle.Fill; //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //add the splitcontainer
44
Controls.Add(split); //add the button control to panel1 panel1.Controls.Add(richtextbox1); } 4. Run the program.
This Topic Illustrates the Following: The following graphic depicts a C1SplitContainer control with a RichTextBox control docked within Panel 1.
5. In Code
Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer
45
3.
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new Dim panel1 As Dim panel2 As Dim panel3 As panel for the split container New C1SplitterPanel() New C1SplitterPanel() New C1SplitterPanel()
'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) split.Panels.Add(panel3) panel1.Text = "Panel 1" panel2.Text = "Panel 2" panel3.Text = "Panel 3" 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for C1SplitterPanel panel1 = C1SplitterPanel panel2 = C1SplitterPanel panel3 = the new new new split container C1SplitterPanel(); C1SplitterPanel(); C1SplitterPanel();
//add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); split.Panels.Add(panel3); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; panel2.Text = "Panel 3"; //add the splitcontainer Controls.Add(split); } 4. Run the program.
This Topic Illustrates the Following: The following graphic depicts a C1SplitContainer control with three C1SplitterPanels.
46
47
In Code: Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: 3. Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() 'add the panel to the splitcontainer split.Panels.Add(panel1) panel1.Text = "Panel 1" set Panel 1 backcolor to lightblue Panel.BackColor = Color.LightBlue
48
'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); panel1.Text = "Panel 1"; //set Panel 1 backcolor to lightblue Panel.BackColor = Color.LightBlue; //add the splitcontainer Controls.Add(split); } 4. Run the program.
This Topic Illustrates the Following: The image below shows Panel 1 with a LightBlue background.
49
2.
In the C1SplitContainer Properties window set the BorderColor property to Black. The border color is updated on the C1SplitContainer control.
In Code: Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: 3. Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() set splitcontainer border color to black split.BorderColor = Color.Black 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //set splitcontainer border color to black split.BorderColor = Color.Black; //add the splitcontainer Controls.Add(split); }
4.
This Topic Illustrates the Following: The image below shows the C1SplitContainer with a black border.
50
The C1SplitContainer control adopts the Office2010Blue visual style. In Code Complete the following steps: 1. Add the C1.Win.C1SplitContainer.dll reference to your project.
51
2.
Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer
3.
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() set splitcontainer visual style to office2010blue split.VisualStyle = VisualStyle.Office2010Blue 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //set splitcontainer visual style to office2010blue split.VisualStyle = VisualStyle.Office2010Blue //add the splitcontainer Controls.Add(split); }
4.
This Topic Illustrates the Following: The following image shows a C1SplitContainer with the Office2010Blue visual scheme:
52
In Design View Complete the following steps: 1. 2. 3. 4. In Code Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: 3. Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer Add the C1SplitContainer to the form. Click on the C1SplitContainers smart tag to open its tasks menu. Select Add Panel once to add another panel to the C1SplitContainer control. In the C1SplitContainer Properties window, set the SplitterWidth property to 40.
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" set the splitter width to 40 pixels Split.SplitterWidth = 40 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2);
53
panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //set the splitter width to 40 pixels split.SplitterWidth = 40; //add the splitcontainer Controls.Add(split); } 4. Run the program.
This topic illustrates the following: The following image displays a vertical C1SplitContainer with its SplitterWidth property set to 40 pixels:
54
Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: 3. Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //add the splitcontainer Controls.Add(split); }
4.
This topic illustrates the following: The splitter bar and panels appear horizontal. The result of this topic will resemble the following image:
55
In Code Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: Visual Basic using C1.Win.C1SplitContainer;
56
3.
C# Imports C1.Win.C1SplitContainer
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" panel1.Dock = DockStyle.Left 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel(); //add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //dock panel 1 to the left Panel1.Dock = DockStyle.Left; //add the splitcontainer Controls.Add(split); }
4.
This Topic Illustrates the Following: The splitter bar is now vertical. The final result of this topic will resemble the following image:
57
This Topic Illustrates the Following: The following image displays C1SplitContainer2 nested within the bottom left panel of C1SplitConainer1:
58
For more information on full-size splits, see Full-Size Split (page 36). In Design View Complete the following steps: 1. 2. 3. 4. 5. In Code Complete the following steps: 1. 2. Add the C1.Win.C1SplitContainer.dll reference to your project. Declare the following C1.Win.C1SplitContainer namespace at the top of your code page: 3. Visual Basic using C1.Win.C1SplitContainer; C# Imports C1.Win.C1SplitContainer Add C1SplitContainer to the form. Click on the C1SplitContainers smart tag to open its tasks menu. Select Add Panel once to add one more C1SplitterPanel to the C1SplitContainer control. Select C1SplitContainer1 from the Properties list dropdown box and set its C1SplitContainer.Dock property to Fill. Run the program and observe that the control expands to the width and height of your Windows form.
Add the following code in the Form_Load event: Visual Basic Private Sub Form1_Load(sender As Object, e As EventArgs) 'create new splitcontainer Dim split As New C1SplitContainer() 'create a new panel for the split container Dim panel1 As New C1SplitterPanel() Dim panel2 As New C1SplitterPanel() 'add the panels to the splitcontainer split.Panels.Add(panel1) split.Panels.Add(panel2) panel1.Text = "Panel 1" panel2.Text = "Panel 2" split.Dock = DockStyle.Fill 'add the splitcontainer Controls.Add(split) End Sub C# private void Form1_Load(object sender, EventArgs e) { //create new splitcontainer C1SplitContainer split = new C1SplitContainer(); //create a new panel for the split container C1SplitterPanel panel1 = new C1SplitterPanel(); C1SplitterPanel panel2 = new C1SplitterPanel();
59
//add panel1 to the splitcontainer split.Panels.Add(panel1); split.Panels.Add(panel2); panel1.Text = "Panel 1"; panel2.Text = "Panel 2"; //create a full size split split.Dock = DockStyle.Fill; //add the splitcontainer Controls.Add(split); } 4. Run the program and observe that the control expands to the width and height of your Window Form.
This Topic Illustrates the Following: The C1SplitContainer expands to the width and height of your Window Form.
60
3. 4. 5. 6. In Code
Select Add Panel to add a panel to the C1SplitContainer control. Click inside Panel1 and open its tasks menu. The C1SplitterPanel Tasks menu appears. Check Collapsible to make Panel1 collapsible and expandable. Right-click inside Panel1and select Properties. In the Properties window, set the CollapsedToolTip to Click the button to expand Panel 1.
Complete the following steps: 1. Import the following namespace into your project: Visual Basic Imports C1.Win.C1SplitContainer C# using C1.Win.C1SplitContainer;
2.
Add the following code, which sets the CollapsedToolTip property, to the Page_Load event: Visual Basic Panel1.CollapsedToolTip = "Click the button to expand Panel 1." C# Panel1.CollapsedToolTip = "Click the button to expand Panel 1.";
3.
This Topic Illustrates the Following: After you've built the project, click the button to collapse panel1 and then hover over the splitter bar and observe that a ToolTip has been added to the collapsed splitter bar. The result will resemble the following image:
61
In Design View Complete the following steps: 1. 2. 3. 4. 5. Add C1SplitContainer to the form. Click on the C1SplitContainers smart tag to open its tasks menu. Select Add Panel to add a panel to the C1SplitContainer control. Click inside Panel 1 and open its tasks menu. The C1SplitterPanel Tasks menu appears. Right-click inside Panel 1and select Properties. In the Properties window, set the MinWidth property for Panel 1 to "30".
In Code View Complete the following steps: 1. Declare the following namespace into your project: Visual Basic Imports C1.Win.C1SplitContainer C# using C1.Win.C1SplitContainer;
2.
Add the following code, which sets the MinWidth property, to the Page_Load event: Visual Basic Panel1.MinSize = 30 C# Panel1.MinSize = 30;
3.
This Topic Illustrates the Following: Once you've built the project, drag the splitter bar to the left and observe that it remains at 30 pixels.
62
5. In Code
Complete the following steps: 1. Declare the following namespace into your project: Visual Basic Imports C1.Win.C1SplitContainer C# using C1.Win.C1SplitContainer;
2.
Add the following code, which sets the Collapsible property, to the Form_Load event: Visual Basic Panel1.Collapsible = True C# Panel1.Collapsible = true;
3.
63
64