473,666 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Splitter events in 2.0

Hi,

It seems that I am seeing an inconsistency in the arguments that get passed
to the SplitterMoved vs. SplitterMoving events.

As in, the ones for the SplitterMoving are correct coordinates, and the ones
for SplitterMoving are not.

I have a panel with 2 controls in it and a splitter. I also have a textbox
to log all the values of the events.

I then have the following code to capture the event arguments:

Private Sub Splitter1_Split terMoved(ByVal sender As Object, ByVal e As
System.Windows. Forms.SplitterE ventArgs) Handles Splitter1.Split terMoved
Log("Moved", e.SplitX)
End Sub

Private Sub Splitter1_Split terMoving(ByVal sender As Object, ByVal e As
System.Windows. Forms.SplitterE ventArgs) Handles Splitter1.Split terMoving
Log("Moving", e.SplitX)
End Sub

Private Sub Log(ByVal eventName As String, ByVal num As Integer)
results.Text += eventName + ": " & num & System.Environm ent.NewLine
End Sub
The results I get by running this program and moving the splitter a bit are:

Moving: 76
Moving: 77
Moving: 78
Moving: 79
Moving: 80
Moving: 81
Moving: 82
Moved: 123
Notice that the Moving is being fired correctly for every pixel.

However, when Moved has fired, it thinks that the splitter is at 123. When
clearly it would be at 82, since that is the last time Moving was called.
But in any case, it would not be 41 pixels over.

What is up with this? Am I looking at this the wrong way and doing something
incorrectly? Or is this a bug?
Nov 23 '05 #1
3 978
Marina wrote:
What is up with this? Am I looking at this the wrong way and doing something
incorrectly? Or is this a bug?


I was able to duplicate this behavior. When my splitter was at 0, the
Moved event also reported 0, but as I moved the splitter to the right,
the SplitX value shown in the Moved event was increasingly off. When I
got to 640 on the Moving event, the Moved event reported 940! I
suspect it is a calculation bug or rounding bug in the event code.

Nov 23 '05 #2
Marina wrote:
What is up with this? Am I looking at this the wrong way and doing something
incorrectly? Or is this a bug?


I did the same test with a SplitContainer and it seems to work
correctly. You might try that instead.

Nov 23 '05 #3
Thanks Chris. The other workaround is to keep track of the SplitX in the
Moving event, in the Moved just use whatever value was last set in Moving.

Just wanted to confirm this issue.

Thanks,
Marina

"Chris Dunaway" <du******@gmail .com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Marina wrote:
What is up with this? Am I looking at this the wrong way and doing
something
incorrectly? Or is this a bug?


I did the same test with a SplitContainer and it seems to work
correctly. You might try that instead.

Nov 23 '05 #4

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

Similar topics

7
3302
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
2861
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
4
8095
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...
1
3463
by: Chuck Bowling | last post by:
I have a couple of controls that I'd like to use a vertical splitter control with. My problem is that I want different heights for the controls. Is there any way to set the height of each individual control and still use a splitter?
20
6684
by: Rohit Sharma | last post by:
Hi, My app is ASP .NET VB web application. I want to add a splitter control on it ....much like the msdn library. I have a treeviw on the left side. How can I do it ? I have searched in all the usual places (gotdonet.com/ asp.net etc) but no luck. Cheers Rohit
5
2320
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...
4
1680
by: Marina | last post by:
Hi, It seems that I am seeing an inconsistency in the arguments that get passed to the SplitterMoved vs. SplitterMoving events. As in, the ones for the SplitterMoving are correct coordinates, and the ones for SplitterMoving are not. I have a panel with 2 controls in it and a splitter. I also have a textbox to log all the values of the events.
2
1141
by: sling blade | last post by:
I have a form with a one panel docked to the left and a splitter control docked to the panel. I have no code, events or any other controls on the form. When I adjust the splitter (drag it to the right) I get an "External component has thrown an exception" error when I let go of the mouse button. Here is the stack trace. at
1
6064
by: JDeats | last post by:
I have a simple WinForm with a WinForms splitter down the middle. I would like to make it so when the user clicks on a button inside the left portion of the screen (the panel to the splitters left) that portion of the form is reduced in size by about 90% (I want to shrink this area of the of the form). The splitter doesn't appear to have any methods for programmatic resizing, I tried changing it's width settings and the splitter moved...
3
4165
by: Jeffrey Walton | last post by:
Hi All, I have a horizontal Splitter, for which I would like the top panel to remain 20 pixels in height. I do this because I have a containter on it, and I overide the OnPaint method. It is being painted as a band similar to that of Disk Defragmentor. Any ideas on how to disable a Splitter panel from being resized? I've locked the controls (it stops me from resizing it at design time); I've set SplitterFixedPanel = Panel1 ; and I've...
0
8440
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
8355
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
8866
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
8781
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...
0
8638
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
7381
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
6191
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...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.