Jump to content
Sign in to follow this  
Pa Callender

.NET System.Windows.Forms class

Recommended Posts

Pa Callender

As a small experiment I'm trying to use the System.Windows.Forms class of .NET as a replacement to GUICreate to discover more about .NET. But I've run into a major problem. Here:

$form1 = ObjCreate("System.Windows.Forms.Form")
$form1.Text = "Hello"
$form1.HelpButton = True
$form1.MaximizeBox = False
$form1.MinimizeBox = False
$button1 = ObjCreate("System.Windows.Forms.Button")
$button1.Text = "OK"

While 1

;Func form1_FormClosed()
;    Exit

As you can see, if you run the form, you get a GUI with the caption "Hello" and a Help Caption button. But my problem is trying to recreate the functionality of

new Point(10,10)

I have tried ObjCreate("System.Windows.Forms.Point") and that doesn't exist.

I've also tried $form1.Point, $button1.Point and System.Windows.Forms > Point, but to no avail.

Could anyone enlighten me?

[size="4"]YOU SHALL NOT PARSE!![/size]

Share this post

Link to post
Share on other sites

I have been trying to get the right object ALL DAY!

System.Windows.Forms was closest for me.. :P How did you figure out, what to use?

I am trying to do a FileSaveDialog using the System.Windows.Forms.Form. :(

$Obj = ObjCreate("System.Windows.Forms.Form")

MsgBox(0, "", $Obj)

Returns 0.. :shocked:

Edited by Manadar

Share this post

Link to post
Share on other sites

ObjCreate(" System.Drawing.Point") ?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.