Message 1 of 2
Draw a custom WPF-dialog window by means of iLogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to know whether it possible to draw a custom WPF-dialog window by means of iLogic code?
Context:
Thanks to @JBerns (and guys from Manufacturing DevBlog) I do know it is possible to draw a custom Windows-form-dialog by means of iLogic (VB.net) code (see. this thread).
... but WPF is known as much more progressive over Windows form.
I thought I only need to change a dialog type from Form to Window but I get "Type 'Window' is not defined." error instead.
My code is:
AddReference "System.Drawing"
Imports System.Drawing
Imports System.Windows.Forms
Sub Main
Dim oLabel As New Label
With oLabel
.Text = "Hello, world!"
.TextAlign = ContentAlignment.MiddleCenter
.Size = New Size(380, 100)
End With
' Dim MyDialog As New Form
Dim MyDialog As New Window ' ??? Type 'Window' is not defined. ???
With MyDialog
.Font = New Font ("Calibri", 30)
.Size = New Size(400, 150)
.Text = "The greeting"
.Controls.Add(oLabel)
End With
MyDialog.ShowDialog()
End Sub
What I'm missing?
Please vote for Inventor-Idea Text Search within Option Names