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

Home Posts Topics Members FAQ

Problem with SplitContainer control

26 New Member
Hello,

I have developed one user control using SplitContainer.
It is simply like two textboxes connected to each other with splitter in between them.

Whenever I increase width of the control
1. By dragging it with right edge, I want the splitter and the left textbox to remain fixed and
2. By dragging it with left edge, I want the splitter and the right textbox to remain fixed.

We can set only one of the panels as FixedPanel.

Initially i set splitContainer.FixedPanel = FixedPanel.None;

then at runtime in event handlers for

1. panel1 : in splitContainer_Panel1_Resize
{
splitContainer.FixedPanel = FixedPanel.Panel2;
}
2. panel2 : splitContainer_Panel2_Resize
{
splitContainer.FixedPanel = FixedPanel.Panel1;
}

but whether I resize from right edge or left edge the event handler for Panel1 is always getting called first and then for second. And these both event handlers get called multiple times so this is not working.

How can this problem be solved?????

Regards
Abhishek
Feb 20 '09 #1
5 4728
vekipeki
229 Recognized Expert New Member
How did you implement control resizing? Is it a Form, or a custom Control which can be resized in your parent Form?

I am asking because I don't understand which edge you are referring to when saying "dragging it with left/right edge" - Form's edge or Control's edge?
Feb 20 '09 #2
kulabhishek
26 New Member
Its user control, Like textbox i am resizing the control itself.
Feb 20 '09 #3
vekipeki
229 Recognized Expert New Member
But you are talking about resizing while in designer mode, not in runtime?
Feb 20 '09 #4
kulabhishek
26 New Member
No. Resizing at runtime.

The user can drag and drop control on grid at runtime and then I am allowing user to resize the control at runtime, and above problem is coming at runtime.
Feb 20 '09 #5
vekipeki
229 Recognized Expert New Member
That's why I asked about how you implemented control resizing. I believe you had to write some code of your own (handling some MouseDown/MouseMove events), or used some open-source solution. In that case you should have the information about the edge being dragged inside those handlers, which will help you decide which of the panels should remain static.

It's too late to set the FixedPanel property inside the Resize event handler, since it means that resizing has already been done for that control. So, you have to fix your panels when handing MouseDown.
Feb 20 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3067
by: J.S. | last post by:
I have a TreeView control in the left panel of a SplitContainer. When I click on various nodes in the TreeView I would like different sets of buttons and textboxes to appear in the right panel. ...
1
2025
by: Tom Bianchi | last post by:
Hi, is it possible to make a SplitContainer double buffered ? Deriving and setting the style in the constructor doesn't seem to work, maybe because it is composed by two normal Panels... ...
0
1425
by: Didier Bolf | last post by:
hello I use the framework2.0 When you have a Form which contains a usercontroll which contains a splitcontainer which contains a TreeView in the left panel of the splitcontainer. Then when...
1
5333
by: Ronald S. Cook | last post by:
At design time, how can I change the name of the SplitterPanels that are children within my SplitContainer control? I was able to name the SplitContainer splContainer, but I can't see how to...
7
10340
by: newscorrespondent | last post by:
I want to save the state of a splitcontainer when an application ends. I also save the form state. The SplitContainer does not seem to have a well defined place to put intiialization and...
0
1273
by: Ronald S. Cook | last post by:
Thanks in advance for reading/responding. In my Windows forms app, I was going to have an Infragistics ListBar control docking/filling the left panel of a SplitContainer, and use the right panel...
2
6211
by: Doc John | last post by:
We developed a Win application that basically consists of an Mdi Form and several child Forms. Now we want to change its appearance so that it has an Outlook-like appearance: it would have a panel...
1
2105
by: Zoliq | last post by:
Hi, I have the following problem: have a splitcontainer with horizontal orientation. The application saves the current settings of the user interface including the splitter distance when the form...
10
2458
by: Rotsey | last post by:
Hi, I have a Listbox in a Panel of SplitContainer. I want to anchor it so the listbox grows/shrinks vertically with the resizing the splitcontainer. This is my code What happens is it...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
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...
0
7504
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...
1
5059
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...
0
3211
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...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
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...

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.