[Mono-list] Issues using localization in WinForms
Fischer Tobias
T.Fischer at servonic.de
Wed Aug 24 10:12:54 EDT 2011
Hi,
I think I discovered two bugs in mono that only occur when using
localization in WinForms.
I am using MS Visual Studio 2005.
Environments used for testing:
Ubuntu 32 bit 10.04 / Mono 2.4.4
Ubuntu 32 bit 11.10 alpha / Mono 2.10.3
Windows 7 32 bit / Mono 2.10.4
Bug 1) Missing property values in System.Windows.Forms.TreeNode: Name,
Tag
Steps to reproduce:
- Create a new Windows Application in Visual Studio
- Add a TreeView to the form and a few nodes to this treeview
- Add an event handler to the treeview that receives a TreeNode (e.g.
AfterSelect):
private void treeView1_AfterSelect(object sender,
TreeViewEventArgs e)
{
Console.WriteLine("Event node name: " + e.Node.Name +
"\r\n"+
"Selected node name: " +
treeView1.SelectedNode.Name);
MessageBox.Show("Event node name: " + e.Node.Name +
"\r\n"+
"Selected node name: " +
treeView1.SelectedNode.Name);
}
- if you compile now and execute on mono you will get the expected
result (correct names of the nodes)
- now set the Form's Localizable property to true (no need to actually
add another language) and compile
- now you will see, that on mono the Name property is empty.
The same effect occurs with property Tag.
Bug 2) System.Windows.Forms.TableLayoutPanel when calling
ColumnStyles.Clear() or RowSyles.Clear() a null reference exception is
raised
Steps to reproduce:
- Create a new Windows Application in Visual Studio
- Add a TableLayoutPanel
- Add a button that calls tableLayoutPanel1.ColumnStyles.Clear();
- with Form1.Localizable = false it will work, with Form1.Localizable =
true the following exception will be raised when running in mono:
System.NullReferenceException: Object reference not set to an instance
of an object
at System.Windows.Forms.TableLayoutStyleCollection.Clear ()
[0x00000] in <filename unknown>:0
at treeTest.Form1.button1_Click (System.Object sender,
System.EventArgs e) [0x00000] in <filename unknown>:0
Is this a known issue or is there a solution for this problem, since I
can't find anything about it in Bugzilla.
Should I fill a bug for these issues?
Thanks you,
Tobias
More information about the Mono-list
mailing list