|
Perfect library!!! -a comment of a programmer who is much more closer to user side in knowladge metric.
Just a simple novice question. When I execute Pallacontrols solution file and then press start the project looks for a file named "c:\exemplos de palla\dotnet\testeslistboxvb\bin\testeslistboxvb.exe" and then stops.
Also i would be glad to know the licensing constraints. Thanks a lot.
|
|
|
|
|
Hi,
How do you do? Thank you for your comment! With relationship to the problem that you told, it is enough to open the properties of the project, in the debugging option and to remove the reference to this project. (I will remove this in the next updating that I am preparing)
Greetings,
Marcelo Palladino
Brazil
|
|
|
|
|
thank you marcello. What about licensing? I am considering to use pallacontrols on a simulation software in my lectures and most probably will be sold to other universities.
best regards.
|
|
|
|
|
Hi,
It can use without restrictions, but I can make three requests?
1-if possible, maintain the credits contained in the file "Credits.txt"
2-if possible, maintain my credit
3-if you do some cool change, don't forget to send it for me
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
It is true that many people look for controls libraries in the community, and with several libraries, people try to do their own library (the best of course).
But it is rare that people give later their library.
Many thanks to do that. It's a great work well structured with folders, subfolders ..
a question : have you (or anybody) this library in vb.net ? is is planed ?
a remark : i think you may change in PallaControls.windows.forms.csproj.user :
StartAction = "Program"
StartArguments = ""
StartPage = ""
StartProgram = "C:\Exemplos do Palla\dotnet\TestesListBoxVB\bin\TestesListBoxVB.exe"
by
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
and choose the start project, because there is a problem in debug mode.
Cheers,
Dominique
|
|
|
|
|
Hi Dominique,
Most that I learned has origin in the professionals' of the whole world work that like the same thing that us: To learn! To publish sources for me has these two meanings. To learn and to thank! (beautiful mantra, is not? )
Unhappily VB.NET is not my fort. If somebody wants to migrate I can help, but to do alone it is not something that I drift...
You are right, was making a test requested by our friend JeffGreen and I forgot to remove the options for removal. In the next version I will make this. Thank you!
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
First of all, congratulations for your excellent job.
I've found a problem in PallaControls.Windows.Forms.ControlBase.OnGotFocus override (ControlBase.cs, line 107), your method calls base.OnLostFocus but it should call base.OnGotFocus, and in textbox implementation, should be desirable that the capture of GotFocus and LostFocus events of internal textbox (m_pTextBox) , rises at his time the base.OnGotFocus and base.OnLostFocus to acomplish the functionality of the events to the outside of the library.
ex:
private void m_pTextBox_OnGotFocus(object sender, System.EventArgs e)<br />
{<br />
this.BackColor = this.m_EditFocusedColor; <br />
this.OnGotFocus(e);<br />
}<br />
<br />
private void m_pTextBox_OnLostFocus(object sender, System.EventArgs e)<br />
{<br />
this.BackColor = this.Style!=null?this.Style.InteliEditColor(this.ReadOnly,this.Enabled):<br />
StyleGuide.InteliEditColor(this.ReadOnly,this.Enabled,this.m_EditColor, this.m_EditReadOnlyColor, this.m_EditDisabledColor);<br />
DrawControl(this.ContainsFocus);<br />
this.OnLostFocus(e); }
Thanks again for this great library .
Hzi.
|
|
|
|
|
Hi Hzi,
First, thank you for commenting and find/resolve a bug with GotFocus and LostFocus. Today I updated the file of the sources with your corrections.
Greetings,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi Marcelo,
When adding an Object to the listbox (Text and a Value), I can't get the text to display. I think this is a bug as the MS control worked fine with my code.
Keep up the good work.
Regards,
Jeff
|
|
|
|
|
Hi Jeff,
How do you do? Well, I believe that you are right! You can post your code (just a relevant snippet) for me to do a test similar to yours? Thank you again!
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi Marcelo,
Here is all the code from a Test VB form - if you replace all the code in a VB form with this then you can easily test.
The code has your Listbox and also the MS Listbox, your listbox does not show the text, whereas the MS does.
Regards,
Jeff
Public Class tester
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents ListBox1 As PallaControls.Windows.Forms.ListBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ListBox2 As System.Windows.Forms.ListBox
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.ListBox1 = New PallaControls.Windows.Forms.ListBox
Me.Button1 = New System.Windows.Forms.Button
Me.ListBox2 = New System.Windows.Forms.ListBox
Me.SuspendLayout()
'
'ListBox1
'
Me.ListBox1.BorderColor = System.Drawing.Color.FromArgb(CType(222, Byte), CType(217, Byte), CType(207, Byte))
Me.ListBox1.BorderHotColor = System.Drawing.Color.FromArgb(CType(222, Byte), CType(217, Byte), CType(207, Byte))
Me.ListBox1.ColumnWidth = 0
Me.ListBox1.DockPadding.All = 1
Me.ListBox1.EditColor = System.Drawing.Color.FromArgb(CType(242, Byte), CType(242, Byte), CType(228, Byte))
Me.ListBox1.EditDisabledColor = System.Drawing.Color.FromArgb(CType(238, Byte), CType(238, Byte), CType(225, Byte))
Me.ListBox1.EditFocusedColor = System.Drawing.Color.White
Me.ListBox1.EditReadOnlyColor = System.Drawing.Color.FromArgb(CType(238, Byte), CType(238, Byte), CType(225, Byte))
Me.ListBox1.FlashColor = System.Drawing.Color.FromArgb(CType(170, Byte), CType(170, Byte), CType(221, Byte))
Me.ListBox1.Location = New System.Drawing.Point(28, 23)
Me.ListBox1.MultiColumn = False
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.ParentStyle = False
Me.ListBox1.SelectedIndex = -1
Me.ListBox1.SelectedItem = Nothing
Me.ListBox1.SelectedValue = Nothing
Me.ListBox1.SelectionMode = System.Windows.Forms.SelectionMode.One
Me.ListBox1.Size = New System.Drawing.Size(180, 173)
Me.ListBox1.Sorted = False
Me.ListBox1.Style = Nothing
Me.ListBox1.TabIndex = 0
Me.ListBox1.TextColor = System.Drawing.Color.Black
Me.ListBox1.TopIndex = 0
Me.ListBox1.ValueMember = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(147, 216)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(71, 28)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Test"
'
'ListBox2
'
Me.ListBox2.Location = New System.Drawing.Point(225, 17)
Me.ListBox2.Name = "ListBox2"
Me.ListBox2.Size = New System.Drawing.Size(182, 173)
Me.ListBox2.TabIndex = 2
'
'tester
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(418, 266)
Me.Controls.Add(Me.ListBox2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.ListBox1)
Me.Name = "tester"
Me.Text = "tester"
Me.ResumeLayout(False)
End Sub
#End Region
Public Class GroupClass
Friend Structure struct_StockGroup
Friend ID As Long
Friend Description As String
Public Overrides Function ToString() As String
Return Description
End Function
End Structure
Friend Record() As struct_StockGroup
End Class
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim g As New GroupClass
Dim i As Integer
For i = 1 To 10
ReDim Preserve g.Record(i)
g.Record(i).ID = i
g.Record(i).Description = "My Test " & CStr(i)
ListBox1.Items.Add(g.Record(i))
ListBox2.Items.Add(g.Record(i))
Next
End Sub
End Class
|
|
|
|
|
Hi Jeff,
Thank you for posting the code for test. Seemingly I got solved the bug that you told. Please see what happens in your cases.
Greetings,
Marcelo Palladino
Marcelo Palladino
Brazil
|
|
|
|
|
Marcelo,
Excellent package. Well done.
Regarding this ListBox issue...has it been resolved? I've got the same problem with the ComboBox, but only when databinding. Works fine if you add string items.
Thanks
Ron
|
|
|
|
|
Hi Ron,
Thank you for commenting. Only looks, seemingly I repaired this. If you have a code that is not working, send me so that I can try to reproduce the problem for here.
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi Marcelo,
The ComboBox control has to be a lot longer than the text within otherwise it won't show all the text.
Regards,
Jeff
|
|
|
|
|
Hello again, Jeff
The one that I did here went to increase the area of edition of the control. There is not a lot what to do, I hope this works.
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi, very nice controls, but.. how do i do if à just want one control ?
|
|
|
|
|
Hi krazitchek,
Thank you for your comment! See, you can detach any one of them calm. Perhaps the work that you have is due to hierarchy of the controls and the "married" functionalities as it is the case of StyleGuide control.
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi Marcelo,
The Enter Key does not register in Keypress/keydown/keyup in the ButtonEdit control.
In the TextBox control the Enter key only registers in the Keyup event
Regards,
Jeff
|
|
|
|
|
Hi Jeff,
You are right. I gave a "general cleaned " in the edition components for these subjects of the keys. I think now it is in the right road, still with some bugs but in the right road. See what you think...
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi,
The TextBox and ButtonEdit controls KeyPress/KeyUp/KeyDown events do not work.
Regards,
Jeff
|
|
|
|
|
Once again you are right, Jeff. In TextBox, ListBox, MenuListBox everything working well now. However, with ButtonEdit and ComboBox the event "KeyUp" is not still working. I will look with more calm in next days...
Thank you very much, once again and a great hug,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi!
First of all: excellent work! These controls rock!!!!!
I ran into some slight problems with date parsing though. I'm Dutch, and we use dashes for dates, for one. Your controls had problem parsing them, accepting only slashes. Therefore I made some modifications that may help people using other cultural settings. The functions I have replaced are here:
(TextBoxBase.cs)
<br />
<small><br />
<pre><br />
protected virtual bool HandleTime(char keyChar)<br />
{<br />
if (!this.ReadOnly) <br />
{<br />
if (Char.IsDigit(keyChar) || <br />
keyChar == CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator[0] || keyChar == 8 ||<br />
keyChar == 22 || keyChar == 3 || <br />
keyChar == 26 || keyChar == 24)<br />
{ <br />
if (this.ErrorOcurred != null)<br />
{<br />
ErrorOcurredEventArgs oArg = new ErrorOcurredEventArgs("");<br />
ErrorOcurred(this, oArg); <br />
}<br />
<br />
if (keyChar != 8 && keyChar != 22 && <br />
keyChar != 3 && keyChar != 26 && keyChar != 24)<br />
{<br />
if (this.SelectedText == this.Text) this.Clear();<br />
if (keyChar != CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator[0] )<br />
{<br />
if (this.Text.Length == 2 || this.Text.Length == 5) <br />
this.AppendText(CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator);<br />
}<br />
if(this.Text.Length == 8)<br />
return true;<br />
}<br />
}<br />
else<br />
{<br />
ErrorOcurredEventArgs oArg = null;<br />
if (this.ErrorOcurred != null)<br />
{<br />
oArg = new ErrorOcurredEventArgs(ResourceLibrary.GetString(WindowsControlsResourceKeys.OnlyDigitsTwoPointsAccepted,WindowsControlsResourceKeys.Root));<br />
ErrorOcurred(this, oArg); <br />
}<br />
return true;<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
<br />
protected virtual bool HandleDate(char keyChar)<br />
{<br />
if (!this.ReadOnly) <br />
{<br />
if (Char.IsDigit(keyChar) || <br />
keyChar == CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator[0] || keyChar == 8 ||<br />
keyChar == 22 || keyChar == 3 || <br />
keyChar == 26 || keyChar == 24 || keyChar == 27)<br />
{ <br />
if (this.ErrorOcurred != null)<br />
{<br />
ErrorOcurredEventArgs oArg = new ErrorOcurredEventArgs("");<br />
ErrorOcurred(this, oArg); <br />
}<br />
<br />
if (keyChar != 8 && keyChar != 22 && <br />
keyChar != 3 && keyChar != 26 && keyChar != 24 && keyChar != 27)<br />
{<br />
if (this.SelectedText == this.Text) this.Clear();<br />
if (keyChar != CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator[0] )<br />
{<br />
if (this.Text.Length == 2 || this.Text.Length == 5) <br />
this.AppendText(CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator);<br />
}<br />
if(this.Text.Length == 10)<br />
return true;<br />
}<br />
}<br />
else<br />
{<br />
ErrorOcurredEventArgs oArg = null;<br />
if (this.ErrorOcurred != null)<br />
{<br />
oArg = new ErrorOcurredEventArgs(ResourceLibrary.GetString(WindowsControlsResourceKeys.OnlyDigitsBarAccepted,WindowsControlsResourceKeys.Root));<br />
ErrorOcurred(this, oArg); <br />
}<br />
return true;<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
private bool ValidateDate()<br />
{<br />
if (this.Required || this.TextLength > 0)<br />
{<br />
<br />
DateTimeFormatInfo format = CultureInfo.CurrentCulture.DateTimeFormat;<br />
try<br />
{<br />
<br />
DateTime.Parse(this.Text, format);<br />
<br />
}<br />
catch<br />
{<br />
<br />
if (this.ErrorOcurred != null)<br />
{<br />
string sDateFormat = format.ShortDatePattern;<br />
<br />
ErrorOcurredEventArgs oArg = new ErrorOcurredEventArgs(string.Format(ResourceLibrary.GetString(WindowsControlsResourceKeys.InvalidDateFormat,WindowsControlsResourceKeys.Root), sDateFormat));<br />
ErrorOcurred(this, oArg); <br />
}<br />
return true;<br />
<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
<br />
protected virtual bool ValidateTime()<br />
{<br />
if (this.Required || this.TextLength > 0)<br />
{<br />
DateTimeFormatInfo format = CultureInfo.CurrentCulture.DateTimeFormat;<br />
<br />
try<br />
{<br />
<br />
DateTime.Parse(this.Text, format);<br />
if (!CommonHelpers.IsDateOk(this.Text))<br />
{<br />
if (this.ErrorOcurred != null)<br />
{<br />
ErrorOcurredEventArgs oArg = new ErrorOcurredEventArgs(string.Format(ResourceLibrary.GetString(WindowsControlsResourceKeys.InvalidTime,WindowsControlsResourceKeys.Root), format.ShortTimePattern));<br />
ErrorOcurred(this, oArg); <br />
}<br />
return true;<br />
}<br />
<br />
}<br />
catch<br />
{<br />
<br />
if (this.ErrorOcurred != null)<br />
{<br />
ErrorOcurredEventArgs oArg = new ErrorOcurredEventArgs(ResourceLibrary.GetString(WindowsControlsResourceKeys.InvalidTimeFormat,WindowsControlsResourceKeys.Root));<br />
ErrorOcurred(this, oArg); <br />
}<br />
return true;<br />
}<br />
}<br />
return false;<br />
}<br />
<br />
</pre><br />
</small><br />
These replacements seem to solve international handling. Please note a change I made in my resources. Instead of having a text like 'Invalid date format; 00/00/0000' in the resource file, I replaced it with 'Invalid date format; {0}'. The {0} is replaced in the error messages with the correct cultural pattern for either date or time.
I hope these changes help. In the meantime, I'll look into more extentions. For instance, I'd like to add a regular expression as a mask. Also I'm looking for a way to infuse my own message at run time in the error provider.
Keep up the excellent work!
Best regards,
Geri
|
|
|
|
|
WOW! Thank you for your alterations (they helped too much). You are really right, was very better!! As your ideas, I was thinking about creating one more mask (CustomWithRegularExpression) and a property for RegularExpression. For message, to create an event that would only be generated when it happens a mistake with this mask (validate). This event could have an argument (e.CustomErrorMessage) that would be reviewed internally for ErrorProvider. What do you think?
Once again thank you very much and I wait that we speak to each other more times.
Hugs,
Marcelo Palladino
Brazil
|
|
|
|
|
Hi Marcelo!
The regular expression solution sounds great.
The custom error message should always override the internal messages. They should, ofcourse, only be displayed in the ErrorProvider when validation fails. So if the validation fails, the custom error message should be displayed when there is one, otherwise the internal message should be shown.
Another small thing I ran into. Try the following: Set a textbox to Numeric. DecMinVal = 2, DecMaxVal = 100. Now try press 1... At least, it failed with me. But maybe I messed around in a wrong place, who knows... Blocking the following piece of code from HandleNumeric solved it for me though:
string nText = val.Insert(curPos,pressedChar.ToString(CultureInfo.CurrentCulture));
double decVal = CommonHelpers.StringToDouble(nText);
if(decVal > mDecMaxValue || decVal < mDecMinValue)
{
return false;
}
I hope it helps!
Hugs,
Geri
|
|
|
|
|