Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using Winforms... #11

Closed
IBIT-ZEE opened this issue Jul 23, 2021 · 1 comment
Closed

using Winforms... #11

IBIT-ZEE opened this issue Jul 23, 2021 · 1 comment

Comments

@IBIT-ZEE
Copy link

IBIT-ZEE commented Jul 23, 2021

Please provide a example of how to access "System.Windows.Forms"


OS -is- Windows 10 (x86_64-w64-mingw32)
Julia Version 1.6.2 -and- LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
dotnet --version >> 5.0.302
Project.toml [5091b313] DotNET v0.1.2 https://github.com/azurefx/DotNET.jl#master

@azurefx
Copy link
Owner

azurefx commented Aug 23, 2021

Have you installed .NET Desktop Runtime? The desktop runtime contains a .NET Runtime and a bunch of assemblies related to GUI.

If you have a desktop runtime, you need to load them first:

julia> T"System.Reflection.Assembly".LoadFrom(raw"C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\3.1.18\System.Windows.Forms.dll")
System.Reflection.RuntimeAssembly("System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")

julia> Form = T"System.Windows.Forms.Form, System.Windows.Forms"
System.Windows.Forms.Form

julia> myform = Form.new()
System.Windows.Forms.Form("System.Windows.Forms.Form, Text: ")

julia> myform.Text = "Hello, Julia!"
"Hello, Julia!"

julia> myform.ShowDialog()
System.Windows.Forms.DialogResult("Cancel")

form example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants