Hi, I'm working on a control contains two listviews which are arranged vertically. I would like to synchronise them to make them appear like just one listview. (they "view" are set to detail, columnStyle is set to "none" for one and to "Clickable" for the other one.) I had allready synchronized the width changing of columns but I can find a way of managing the scrollbar. I would like scrollbar doesn't appear in one listview and would be manage with the other one. Is there anyone who can help me please ? Sincerly
galinace
Posts
-
Controlling the listView's scrollbar with another control. -
Parsing a stringHi, There is a methode you can use for that. Here is an example from the one you wrotte :
int startIndex = 6; int Length = 4; string MyString = "thisissomedatablahblahblah"; string SubString = MyString.Substring(startIndex, Length);
Hop that can help
-
Number FormatHi, I think you should look around
string.Foramt()
methode which can have parameter like NumberFormatInfo MSDN Or, like this example, you can use theToString()
methode :string NumberPrettyPrint(int number){ // Gets a NumberFormatInfo associated with the en-US culture. NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat; nfi.NumberDecimalDigits = 2; return number.ToString("N", nfi); }
Hope that can help
-
Edit text during design-timeHi I'm creating a component inherit from Panel under the .NET Framework 2.0 in C#. This component have a title bar in which I draw a text. I would like to allow other developper who will use my component to edit this text directly via the designer and not only by the propertygrid. For exemple, I would like to do the same thing than in a Menu where you can write the title of your MenuItems in the designer. Is there anybody can help me ?
-
Reduce the container zone of a panel.Hi, I sent the same post on the MSDN's forum and received an other way of doing what we both wanted. I didn't try it for the moment but wanted to keep you informed. You can follow this URL : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=172709&SiteID=1[^] to see the entire conversation but this is the answer of Jelle van der Beek. "The zone in which components cannot be dropped is called the non-client area. There is no support in the .NET framework for the non-client area, but you can still control it by overriding the WM_NC* messages. Here is a piece of sample code that will set the non-client border to 10 pixels wide."
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; using System.Runtime.InteropServices; namespace Foo { public class SomeControl : Control { public SomeControl() { SetStyle( ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true ); } protected override void WndProc( ref Message m ) { switch( m.Msg ) { case 0x0083: // WM_NCCALCSIZE if( m.WParam == IntPtr.Zero ){ RecalcNonClientArea( m.LParam ); } else if( m.WParam == new IntPtr(1) ){ RecalcNonClientArea( m.LParam ); } break; case 0x0085: // WM_NCPAINT IntPtr hDC = WinApi.GetWindowDC( m.HWnd ); if( hDC != IntPtr.Zero ){ using( Graphics maing = Graphics.FromHdc(hDC) ){ // // PAINT HERE // } WinApi.ReleaseDC( m.HWnd, hDC ); } m.Result = IntPtr.Zero; break; } base.WndProc( ref m ); } private void RecalcNonClientArea( IntPtr lParam ) { WinApi.NCCALCSIZE_PARAMS csp; csp = (WinApi.N
-
Reduce the container zone of a panel.Thank you very much. I will try with a child panel with it dockstyle at fill. I hope that won't reduce the executive time. I will told you if I find an other solution. With the pleasure to read your artical very soon
-
Reduce the container zone of a panel.Hi thanks for your post. I'll be very interested on your article about tab control (I'll have to work on this problem in a few day). About the problem of reducing the displayrectangle of my control. I tried the first point you saied
Curtis S. wrote:
1. Override the DisplayRect to return the amount of area that you want the client to use.
The result is :
public override Rectangle DisplayRectangle { get { Rectangle rec = base.DisplayRectangle; return new Rectangle( rec.X+(int)this._epaisseurBord, rec.Y+(int)this._tailleBarTitre, (int)(rec.Width-this._epaisseurBord*2), (int)(rec.Height-this._tailleBarTitre-this._epaisseurBord)); } }
(sorry for the french name of my properties :) ) The problem is I have no result. The breakpoint i used in debug mode show that this property is nerver acces. At the end controls like button or label appear where ever they want on all the surface of my control. The other point you told me are much more for a tabcontrol I think because the goal of my control is to have no control on it but can receive some. Do you have an idea about why that doesn't work ??? Thanks for all -- modified at 4:39 Saturday 17th December, 2005
-
Reduce the container zone of a panel.Hi I’m trying to create my own component under .Net Framework 2.0 in C#. I have a problem on reducing the surface where component can be drop. In fact I would like to have the exact comportment of a winform : one part of my control would be a design surface like the title bar in a form (non accessible by the designer or other control) and an other part would be the container which add controls and where they can draw themselves. Is there anybody who can help me?