Message 1 of 6
MXS dotNet exception
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Why I'm getting an exception here, when <ESC> is pressed ?
fn foo = (
local theFrm = dotNetObject "System.Windows.Forms.Form"
-- doesn't matter - same effect:
--local theFrm = dotNetObject "MaxCustomControls.MaxForm"
theFrm.width = 200
theFrm.height = 100
theFrm.text = "DotNet Form"
local Input = dotNetObject "System.Windows.Forms.TextBox"
Input.location = dotNetObject "System.Drawing.Point" 0 20
Input.width = 50
Input.height = 30
Input.Text = "foo"
theFrm.controls.add Input
-- this assignment causes the exception?!
dotNet.addEventHandler Input "KeyDown" ( fn foo s e = () )
local txt = dotNetObject "System.Windows.Forms.Label"
txt.location = dotNetObject "System.Drawing.Point" 0 2
txt.text = "Press the <ESC> key.."
txt.width = 200
theFrm.controls.add txt
try thefrm.ShowDialog() catch()
)
foo true