473,698 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using splitter

How to use this control?

I have to grids on my form, one on the top and one on bottom.

When I start application I want to be able to move bottom grip up, and top
grid down, but it doesn't work!

Where should I put splitter?

Hrcko
Nov 17 '05 #1
2 5553
Set the "top" DataGrids Dock property to "Top". Set the Splitters Dock
property to "Top". Set the "bottom" DataGrids Dock property to "Fill". Then
select the "top" DataGrid and bring it to the front of the zorder (this is a
button on the Layout toolbar). Then select the Splitter and bring it to the
front of the zorder. Then select the "bottom" DataGrid and bring it to the
front of the zorder. It's really just the right combination of docking and
zordering.

--
Tim Wilson
..Net Compact Framework MVP

"Hrcko" <hr**********@z g.htnet.hr> wrote in message
news:d9******** **@ss405.t-com.hr...
How to use this control?

I have to grids on my form, one on the top and one on bottom.

When I start application I want to be able to move bottom grip up, and top
grid down, but it doesn't work!

Where should I put splitter?

Hrcko

Nov 17 '05 #2
Here is a very simple implementation for you
using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace UsingASplitter
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows. Forms.Form
{
private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.Splitter splitter1;
private System.Windows. Forms.DataGrid dataGrid2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeCompo nent();

//
// TODO: Add any constructor code after InitializeCompo nent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.splitter1 = new System.Windows. Forms.Splitter( );
this.dataGrid2 = new System.Windows. Forms.DataGrid( );
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid2)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. Dock = System.Windows. Forms.DockStyle .Top;
this.dataGrid1. HeaderForeColor = System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(0, 0);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. Size = new System.Drawing. Size(292, 80);
this.dataGrid1. TabIndex = 0;
//
// splitter1
//
this.splitter1. Dock = System.Windows. Forms.DockStyle .Top;
this.splitter1. Location = new System.Drawing. Point(0, 80);
this.splitter1. Name = "splitter1" ;
this.splitter1. Size = new System.Drawing. Size(292, 3);
this.splitter1. TabIndex = 1;
this.splitter1. TabStop = false;
//
// dataGrid2
//
this.dataGrid2. DataMember = "";
this.dataGrid2. Dock = System.Windows. Forms.DockStyle .Fill;
this.dataGrid2. HeaderForeColor = System.Drawing. SystemColors.Co ntrolText;
this.dataGrid2. Location = new System.Drawing. Point(0, 83);
this.dataGrid2. Name = "dataGrid2" ;
this.dataGrid2. Size = new System.Drawing. Size(292, 183);
this.dataGrid2. TabIndex = 2;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(292, 266);
this.Controls.A dd(this.dataGri d2);
this.Controls.A dd(this.splitte r1);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid2)) .EndInit();
this.ResumeLayo ut(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}
Br
Mark.
"Hrcko" <hr**********@z g.htnet.hr> wrote in message
news:d9******** **@ss405.t-com.hr...
How to use this control?

I have to grids on my form, one on the top and one on bottom.

When I start application I want to be able to move bottom grip up, and top
grid down, but it doesn't work!

Where should I put splitter?

Hrcko

Nov 17 '05 #3

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

Similar topics

0
1124
by: MooMaster | last post by:
This is more of a wxPython centric question, but not seeing reference to this on the wx group I thought I'd try here since many here also use wxPython toolkit. I started learning GUI development with Tkinter, and developed a few screens as part of an application I'm building with it. I've recently been trying to learn wxPython because of it's additional widgets (the wxTreeCtrl and Drag and Drop features in particular), and I've developed...
7
3308
by: John | last post by:
Hi, I have a group of controls in a panel on the right-hand side of a splitter and a treeview on the left-hand side. The only configuration that I can find to make the right-hand side resize correctly is: lhsTreeview - Dock = Fill, Anchor = Top,Left splitter - Dock = Right rhsPanel - Dock = Right, Anchor = Top,Left
3
2864
by: Andre Loker | last post by:
Hi! For my current application I'm looking for a four-way-(cross) splitter control (as often seen in 3D-editors). The .NET Splitter-class is (IIRC) only a two-way splitter. Does anyone know such a four-way-splitter control? Regards, Andre Loker
1
22691
by: Krish | last post by:
This is my first try with C# windows gui devlopment, is it correct to say that gui development in C# is windows forms. I would like to create a form with two sections, 2 datagrids, I would like to have a splitter that will allow me to hide the datagrid either the one on top half or the one on the bottom half. I am going thru this, but would appreciate some help in understanding
3
6021
by: MFRASER | last post by:
How do I move the splitter inside of code. if(TypeA) { this.pnlHXMLList.Visible = false; this.splTop.is.Top = 65; } else
4
8100
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to Left, Panel on right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to Left. Works as advertised. But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to...
0
1173
by: Atara | last post by:
I have a mainPanel filled with leftPanel, splitter, rightPanel. all is working fine. I want to add some pictureBox at the edges of the mainPanel (sort of creating a graphic border) 1. If I now calls splitter.bringToFront (because I donot want the pictures to hide it), canitcause to problems in the mainForm 'docking order' ?
5
2322
by: Sam | last post by:
Hi, I have a panel docked to the bottom of my form. This panel can be expanded vertically by clicking on a button. When the user click on the button again, the panel is then collapsed. The panel has a horizontal splitter, which the user can use to resize the panel when it is expanded. I would like to save the height of the panel when the user uses the splitter, so that when the panel is expanded via the button, it size will be...
2
2102
by: eric dexter | last post by:
I am trying to steal this code from the wxpython demo but it appears that mb comes from nowhere and I am having errors because of it import wx #--------------------------------------------------------------------------- class MySplitter(wx.SplitterWindow): def __init__(self, parent, ID, log): wx.SplitterWindow.__init__(self, parent, ID,
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
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
9032
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
8905
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
8880
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
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
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...
3
2008
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.