Bonjour à tous,
Voilà, j'essai d'utiliser une class me permettant de créer une Winform et d'y inclure une PropertyGrid comme ci-dessous:
J'essai d'appeler la procedure New() de la class OptionDialog avec un évênement click depuis ma form principale mais je n'y parviens pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 Imports System Imports System.Drawing Imports System.ComponentModel Imports System.Windows.Forms Imports System.Globalization Public Class OptionsDialog Inherits System.Windows.Forms.Form Private OptionsPropertyGrid As System.Windows.Forms.PropertyGrid Public Sub New() 'Create a New Form MyBase.New() 'Create a New Property Grid OptionsPropertyGrid = New PropertyGrid() OptionsPropertyGrid.Size = New Size(300, 250) 'Add the Property Grid to the form Me.Controls.Add(OptionsPropertyGrid) Me.Text = "Options Dialog" End Sub End Class
Quelqu'un pourrait-il me dire de quelle façon je devrais procéder?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Public Class Main Private Sub PropertiesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PropertiesToolStripMenuItem.Click Call OptionsDialog.new() End Sub End class
Merci
Anthony
Partager