Bonjour !

De ma forme principale, je veux mettre la valeur d'une varaible booléenne à true et changer le texte d'un label.

Voici la fonction qui initialise les valeurs de la form appelé.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
 
    Private Sub StoreGradeAllStoresToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreGradeAllStoresToolStripMenuItem.Click
        Try
            Dim frmRaportSearchCriteria As New frmReportSearchCriteria
            frmReportSearchCriteria.lblSearchCriteriaName.Text = "Brand"
            frmReportSearchCriteria.bolStoreGradeAllStore = True
            frmRaportSearchCriteria.ShowDialog()
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub
D'après le code si dessus, j'aimerais savoir pourquoi, je suis incapable de changer la valeur du texte de mon label ?

Pour la suite de mon problème, voici le code que j'ai dans ma form frmRaportSearchCriteria

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
29
30
31
32
33
34
35
36
37
38
39
 
    Private _STORE_GRADE_ALL_STORE As Boolean
 
    Public Property bolStoreGradeAllStore() As Boolean
        Set(ByVal value As Boolean)
            _STORE_GRADE_ALL_STORE = value
        End Set
        Get
            Return _STORE_GRADE_ALL_STORE
        End Get
    End Property
 
    Private Sub frmReportSearchCriteria_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim strSql As String
            Dim i As Integer
 
            If bolStoreGradeAllStore Then
 
                strSql = "SELECT DISTINCT(brand) AS brand " + _
                         "FROM  StoreProfile  "
 
            MyCommand = New OleDbCommand(strSql, MyConnection)
            MyAdapter.SelectCommand = MyCommand
 
            End If
 
 
            _dsSearchCriteria.Clear()
 
            MyAdapter.Fill(_dsSearchCriteria, "StoreProfile")
 
            For i = 0 To _dsSearchCriteria.Tables(0).Rows.Count - 1
                Me.cboSelection.Items.Add(_dsSearchCriteria.Tables(0).Rows(i).Item("brand").ToString)
            Next
 
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
Avec ce code, dans ma fonction load, ma property bolStoreGradeAllStore retourne toujours faux.

Pourquoi ?

Merci beaucoup pour votre aide.