[Ironruby-core] trouble with super and .NET classes
Dermot Hogan
lists at ruby-forum.com
Mon Oct 8 17:56:24 EDT 2007
Hi John,
Here's some very simple text: a form, a checkbox and a button with a
couple of attributes. I haven't been able run this in IR at all so I've
no idea if it will work or not. However, it looks like the sort of thing
that the Form Designer produces in C# or VB. Tt does 'round trip'
between the designer and persistant store, so it's internally consistent
- I think :)
require 'mscorlib'
require 'System'
require 'System.Windows.Forms'
require 'System.Drawing'
class Form1123 < System::Windows::Forms::Form
attr_accessor :checkBox1
attr_accessor :button2
def InitializeComponent
self.button2 = System::Windows::Forms::Button.new()
self.checkBox1 = System::Windows::Forms::CheckBox.new()
self.SuspendLayout()
#
# button2
#
self.button2.Location = System::Drawing::Point.new(79, 113)
self.button2.Name = "button2"
self.button2.Size = System::Drawing::Size.new(75, 23)
self.button2.TabIndex = 0
self.button2.Text = "button2"
self.button2.TextAlign = System::Drawing::ContentAlignment.TopCenter
self.button2.UseVisualStyleBackColor = true
#
# checkBox1
#
self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top |
System::Windows::Forms::AnchorStyles.Bottom |
System::Windows::Forms::AnchorStyles.Left
self.checkBox1.AutoSize = true
self.checkBox1.Location = System::Drawing::Point.new(79, 61)
self.checkBox1.Name = "checkBox1"
self.checkBox1.Size = System::Drawing::Size.new(90, 17)
self.checkBox1.TabIndex = 1
self.checkBox1.Text = "checkBox1"
self.checkBox1.TextAlign = System::Drawing::ContentAlignment.TopLeft
self.checkBox1.UseVisualStyleBackColor = true
#
# Form1123
#
self.ClientSize = System::Drawing::Size.new(284, 264)
self.Controls.Add(self.checkBox1)
self.Controls.Add(self.button2)
self.Name = "Form1123"
self.ResumeLayout(false)
self.PerformLayout()
end
end
good luck!
Dermot
--
Posted via http://www.ruby-forum.com/.
More information about the Ironruby-core
mailing list