|
Very useful for any beginner or not developper of form
Easy and simple to integrate to your new project
|
|
|
|
|
Hello,
Thank you for this custo component. Very useful for my needs.
It seems first column added to listview is always with HorizontalAlignment fixed to left.
How can we change this behaviour in your code ?
As workaround, is it necessary to add not mandatory column with id value ?
Thank's for reply.
modified 16-Feb-24 13:22pm.
|
|
|
|
|
This is perfect done. Thanks.
|
|
|
|
|
This is a nice, tight control. Well written and easy to use. Two thumbs up!
|
|
|
|
|
|
This is an excellent control! Thank you so much for developing this! This has more functionality than the expensive controls out there, so it is much appreciated.
I have a few questions that are probably easy to answer, but I am new to VB.Net. First, there was a post earlier that asked for the control to collapse when you click off of it. I am trying to add the hide command in the Public Methods region of ExCb.vb file, but doesn't seem to recognize it. How do I access the .vb file when it's not listed in my project?
Also, when running the compiled version, I am getting an error message. Below is a link to the snapshot of the error.
http://postimg.org/image/dwo96oa1h
Any ideas on how to resolve this?
Thanks again!!
|
|
|
|
|
Hi,
First of all, thank you very much for your words about the control.
1) It is very strange the file not be listed in the project....
When you open the Solution (ExCB_Test.sln) or even the Project (ExCB.vbproj), the file (ExCB.vb) appears under project ExCB, in the Solution Explorer window...
Anyway, you can always open the file (... \ ExCB \ ExCB.vb) from the Windows Explorer.
Just locate #Region "Public Methods" inside #Region "Class ExCB" and insert the code at the beginning, like this:
#Region "Public Methods"
Public Sub Clear(Optional ByVal AlsoColumns As Boolean = False)
2) The message ("The system cannot find the file specified") is instructive. The file ExCB.dll must be placed in the Application.StartupPath (the folder where the application executable is).
|
|
|
|
|
OK thanks for the info. The CloseUp routine started working out of the blue. I'm not sure what changed, but I've learned not to question these things . Also, copying the dll to the location of the .exe worked. I did not know that was required.
I have just one more question. Is it possible to have the scroll button on the mouse move the list up or down?
Thanks again for your help and for developing this fabulous control!
|
|
|
|
|
Not sure to understand precisely the question, but it is supposed the mouse wheel to scroll the list ... Doesn't it work with you?
Thanks again.
|
|
|
|
|
No, the mouse wheel does not do anything. The Page Up/Down keys do not move the list either. I can only click the up/down arrows on the vertical scroll bar, or click and drag the scroll cursor block. I have tried toggling the AutoScroll property, but it doesn't change anything.
|
|
|
|
|
It's really strange... I've just download the projects, like any other visitor, loaded the VS2012 version, ran it, and the mouse wheel works fine, of course, with the mouse pointer over any part of the list.
About PageUp and PageDown, look at "Some suggestions" from Member 10630008, below.
|
|
|
|
|
That is strange indeed. I re-downloaded the projects, loaded the VS2012 version, and the example project won't scroll with the mouse wheel either. The wheel works on everything else, like Chrome, etc. That really is weird! One other thing I thought of, does this have the capability to autocomplete? Or at least type the first few letters and it auto-scrolls to that section? Also, do you have a PayPal account? I would gladly donate some money for this control as well as all your help. Thanks
|
|
|
|
|
1) Mouse Wheel - Please, send an email to avefer@gmail.com, so I can send you a program that tests the mouse wheel scrolling, in several controls: ExCB, ListView, ComboBox, ListBox and DataGridView.
2) AutoComplete - Not implemented, however it can be. But, as one needs to change code in several parts, it would be too extensive to present the solution in a post like this. So, I can send you a solution, also by mail.
3) I'm touched by your willingness to make a donation, but in the context of CodeProject my work is for free, so I kindly refuse. I only get money when I work specifically/exclusively for someone. However, if you cherish the Control, I'll be very happy if you upvote the Article. Thanks.
|
|
|
|
|
Hello Avelino!
Thank you for all your work on this control! I used these extensively in Access and didn't want to make forms without it ... I do have a question and a possible issue.
Question
I would like the list to close up when a user clicks off the list or control, or tabs out of the control. Is there a way to do that? Perhaps in the Leave event?
Issue?
I am using your control on a page that is part of a tab control. When I set the MaxRowsDisp = 20, the list goes below the bottom of the form. Normally, I believe that if the Excb control is on the form itself (not on a Tab control), the list will drop down and be visible below the form. But when it is on a page of a tab control (the tab control goes to the bottom of the form), it behaves a little oddly in that the list stops being visible at the bottom of the form. When I scroll down using a mouse the scrolling action works even below the bottom of the form where I can't see the list! So while I can operate the list below the form, I can't see it there.
I set my MaxRowsDisp to 10, so I'm OK with this one. But on another form when I'm using a Tab control it may be best to place the Excb nearer the bottom of the form, and I might only get a few rows to be visible.
Again - Thanks!
Dan
|
|
|
|
|
Hi, Dan
Thank you. Happy because the control is useful to someone.
1) The Leave event will fire only if you click another control, better will be to use also the Form's MouseClick event.
First, in ExCB.vb, region "Public Methods", insert this Sub:
Public Sub CloseUp()
_HideLV()
End Sub
Then, call it from:
Private Sub Excb1_Leave(sender As Object, e As EventArgs) Handles Excb1.Leave
Excb1.CloseUp()
End Sub
Private Sub Form1_MouseClick(sender As Object, e As MouseEventArgs) Handles Me.MouseClick
Excb1.CloseUp()
End Sub
2) The ExCB control will never drop down below the parent Form or TabControl, but the List Height can be adjusted when the Form is resized.
For the Form, see Last Updates 5. 2. - AdjustListHeight
When the ExCB is inside a TabControl, if the TabControl is anchored (Top and Bottom) to the Form, a slightly different Sub can be inserted in ExCB.vb:
Public Sub Adjust_TabCtrl_Height(ByRef TC As TabControl)
Try
Dim TabPageH As Integer = TC.TabPages(0).Height
Dim HeaderH = Math.Max(Sizes.ListHeader_Height, TextRenderer.MeasureText(" ", Me.Font).Height + 4)
Dim RestH As Integer = TabPageH - Me.Top - MyLV1.Top - HeaderH
_MaxDsp = RestH \ (Sizes_.ListRow_Height + 1)
Dim MinRows As Integer = Math.Min(_MaxDsp, MyLV1.Items.Count + 1)
If MyLV1.Visible Then
MyLV1.Height = HeaderH + MinRows * (Sizes_.ListRow_Height + 1)
Me.Height = _LblBoxH + MyLV1.Height
Else
_HideLV()
End If
Catch
End Try
End Sub
Next, call the Sub from the Form, passing your TabControl as a parameter (By reference):
Private Sub Me_Sizes(sender As Object, e As EventArgs) Handles Me.Resize, Me.SizeChanged
Excb1.Adjust_TabCtrl_Height(TabControl1)
End Sub
|
|
|
|
|
Hello Avelino!
I am very happy that you made this control!
I was successful in using your CloseUp method. The control will now operate a little more smoothly.
Have a great New Year!
|
|
|
|
|
Thanks. A great 2016 also to you!
|
|
|
|
|
System.InvalidCastException was unhandled
Message="Conversion from string "24-06-1987" to type 'Double' is not valid."
Source="Microsoft.VisualBasic"
StackTrace:
at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Operators.CompareObject2(Object Left, Object Right, Boolean TextCompare)
at Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectLess(Object Left, Object Right, Boolean TextCompare)
at ExCB.SortLV.Compare(Object x, Object y) in C:\Users\T3328\Downloads\ExCB_src_demo_doc\ExCB\VS2008\ExCB\ExCB.vb:line 1592
at System.Windows.Forms.ListView.CompareFunc(IntPtr lparam1, IntPtr lparam2, IntPtr lparamSort)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at ExCB.MyLV.WndProc(Message& m) in C:\Users\T3328\Downloads\ExCB_src_demo_doc\ExCB\VS2008\ExCB\ExCB.vb:line 1707
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException: System.FormatException
Message="Input string was not in a correct format."
Source="Microsoft.VisualBasic"
StackTrace:
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
InnerException:
Hi I got this when I tried to sort Date Coloumn
File : ExCB.vb
If _Order = 1 Then
Select Case True
Case vX < vY : Return -1
Case vX = vY : Return 0
Case vX > vY : Return 1
End Select
Else
Select Case True
Case vX < vY : Return 1
Case vX = vY : Return 0
Case vX > vY : Return -1
End Select
End If
|
|
|
|
|
Hi, Sreeyush
Such an error (conversion from Date String to Double) does not occur in the indicated comparison instruction, but 6/7 lines above, in the Conversion instructions:
vX = CDate(CType(x, ListViewItem).SubItems(_Column).Text).ToOADate
vY = CDate(CType(y, ListViewItem).SubItems(_Column).Text).ToOADate In my (and many others, I supppose) environment, the instruction
Dim D As Double = CDate("24-06-1987").ToOADate() assigns to D the value 31952
But also "24.06.1987", "24/06/1987", and others, like "1987/06/24", works fine...
"ToOADate" is a member of "System.Date"
However, in the error log I can see:
Message="Input string was not in a correct format."
So, I think the problem should be that your environment (Locale Date Format) does not allow such a format.
I suggest choosing a valid Date Format and specify it in the instruction
Excb1.AddColumn("Birth Date", , HorizontalAlignment.Center, ExCB.ExCB.DataType._Date, "dd-MM-yyyy") [ File Form1 , Sub Players_Column_Definitions() ]
|
|
|
|
|
I have not did anything just run your demo code and try to sort the date coloumn , I will try to change format and try the same
|
|
|
|
|
|
Thank you! Well, retired from the (public) employment... Not from the hobby, the passion. Still working (for my daughters), always learning, forever (I hope)...
|
|
|
|
|
1) Hi, Avelino, this is really an excellent control, but it seems that, in certain circumstances, when font size is increased, the list is slightly truncated (bottom). Isn't?
2) Did you ever have considered the possibility of growing/shrink the list (regardless of MaxRowsDisp property value) when the form is resized?
|
|
|
|
|
Thank you, my friend. Great questions! Challenge accepted. Challenge met (I think...).
Last Updates 5. is for you.
|
|
|
|
|
My deepest thanks. You're terrific!
|
|
|
|
|