Code gets executed but won't show

Stoffel

Member
Joined
Dec 11, 2004
Messages
16
Location
Belgium
Programming Experience
1-3
Hi,

I have this weird problem, and I don't have a clue how to solve it.
I have an mdi Form that loads the childs via a menu, it works fine for all the forms except one. There it won't do one step, whatever I do.

If I look into it by doing everything step by step, I see the code being executed without any errors. But when the forms shows there hasn't changed a thing.

(I have two places where this happens, the code below is from the one described above)
The line in bold is the one that get's executed but won't show up

in my mdi:
VB.NET:
  Private Sub mnuGerNieuw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuGerNieuw.Click
    Dim frm As New frmGerecht
    Dim form As Form
    Dim blnFound As Boolean = False

    'Is frmCategorie al geopend?
    For Each form In Me.MdiChildren
      If form.Name = "frmGerecht" Then
         ...
      End If
    Next

    If blnFound = False Then
      frm.Text = "Gerecht Toevoegen"
      frm.lblHoofd.Text = "Gerecht Toevoegen"

      [b]frm.Switch(True)[/b]
      frm.Status = frmGerecht.enumStatus.Toevoegen

      frm.lstCat.Items.Add("Je moet het Gerecht eerst opslaan")
      frm.lstCat.Items.Add("vooraleer je Categorieën kan toevoegen")
      frm.lstCat.Enabled = False
      frm.lstOverzicht.SelectedIndex = -1

      frm.MdiParent = Me

      mnuGer.Enabled = False

      frm.Show()
    End If
  End Sub

Switch in frmGerecht
VB.NET:
  Public Sub Switch(ByVal sw As Boolean)
    cmdAnnuleren.Enabled = sw
    cmdOpslaan.Enabled = sw
    cmdBewerken.Enabled = Not sw
    cmdToevoegen.Enabled = Not sw
    cmdVerwijderen.Enabled = Not sw
    txtTitel.ReadOnly = Not sw
    txtTijd.ReadOnly = Not sw
    txtPorties.ReadOnly = Not sw
    txtOmschrijving.ReadOnly = Not sw
    txtIngredient.ReadOnly = Not sw
    txtBereiding.ReadOnly = Not sw
    txtTips.ReadOnly = Not sw
    lstOverzicht.Enabled = Not sw
    cboOverzicht.Enabled = Not sw
  End Sub
 
Back
Top