submenuitems not opening

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JR

    #1

    submenuitems not opening

    Hi,

    I make some menuitems at runtime.
    When the user changes somethings it will be necesairely to change that menu.
    so i use clear to empty the menu and add them all again with the new ones.

    the first the the menu is fine but after deleting and adding the little
    arrow is in the menu but its not showing the subitems

    any idees?

    Jan


  • tomb

    #2
    Re: submenuitems not opening

    You'll have to show your code.

    T

    JR wrote:
    >Hi,
    >
    >I make some menuitems at runtime.
    >When the user changes somethings it will be necesairely to change that menu.
    >so i use clear to empty the menu and add them all again with the new ones.
    >
    >the first the the menu is fine but after deleting and adding the little
    >arrow is in the menu but its not showing the subitems
    >
    >any idees?
    >
    >Jan
    >
    >
    >
    >

    Comment

    • JR

      #3
      Re: submenuitems not opening

      Sub sMakeLangMenu()

      Dim M As MenuItem

      Dim stext As String

      mnuLanguages.Me nuItems.Clear()

      Dim di As New System.IO.Direc toryInfo(Applic ation.StartupPa th)

      Me.mnuLanguages .MenuItems.Clea r()

      For Each F As System.IO.FileI nfo In di.GetFiles("La ng_??.xml")

      If F.Name.Length = 11 Then

      Dim L As New clsLanguage

      Dim sr As New System.IO.Strea mReader(F.FullN ame)

      Try

      Dim xml As New System.Xml.Seri alization.XmlSe rializer(L.GetT ype)

      L = xml.Deserialize (sr)

      sText = "(" & F.Name.Substrin g(5, 2) & ") " & L.Language

      M = Me.mnuLanguages .MenuItems.Add( stext, New EventHandler(Ad dressOf
      mnuLanguages_Cl ick))

      If F.Name.Substrin g(5, 2) = Me.Tag Then M.Checked = True

      M.Visible = True

      Catch ex As Exception

      End Try

      sr.Close()

      End If

      Next

      End Sub

      "tomb" <tomb@technetce nter.comschreef in bericht
      news:66X%g.5760 $Bs.2893@bignew s8.bellsouth.ne t...
      You'll have to show your code.
      >
      T
      >
      JR wrote:
      >
      >>Hi,
      >>
      >>I make some menuitems at runtime.
      >>When the user changes somethings it will be necesairely to change that
      >>menu. so i use clear to empty the menu and add them all again with the new
      >>ones.
      >>
      >>the first the the menu is fine but after deleting and adding the little
      >>arrow is in the menu but its not showing the subitems
      >>
      >>any idees?
      >>
      >>Jan
      >>
      >>

      Comment

      • JR

        #4
        Re: submenuitems not opening

        I did some testing.

        with a main menu it works file but a need to do this with a contectmenu and
        in that case it wont work

        Jan
        "JR" <x.x@x.xschre ef in bericht
        news:AAB0h.1525 32$aZ2.2552974@ phobos.telenet-ops.be...
        Sub sMakeLangMenu()
        >
        Dim M As MenuItem
        >
        Dim stext As String
        >
        mnuLanguages.Me nuItems.Clear()
        >
        Dim di As New System.IO.Direc toryInfo(Applic ation.StartupPa th)
        >
        Me.mnuLanguages .MenuItems.Clea r()
        >
        For Each F As System.IO.FileI nfo In di.GetFiles("La ng_??.xml")
        >
        If F.Name.Length = 11 Then
        >
        Dim L As New clsLanguage
        >
        Dim sr As New System.IO.Strea mReader(F.FullN ame)
        >
        Try
        >
        Dim xml As New System.Xml.Seri alization.XmlSe rializer(L.GetT ype)
        >
        L = xml.Deserialize (sr)
        >
        sText = "(" & F.Name.Substrin g(5, 2) & ") " & L.Language
        >
        M = Me.mnuLanguages .MenuItems.Add( stext, New EventHandler(Ad dressOf
        mnuLanguages_Cl ick))
        >
        If F.Name.Substrin g(5, 2) = Me.Tag Then M.Checked = True
        >
        M.Visible = True
        >
        Catch ex As Exception
        >
        End Try
        >
        sr.Close()
        >
        End If
        >
        Next
        >
        End Sub
        >
        "tomb" <tomb@technetce nter.comschreef in bericht
        news:66X%g.5760 $Bs.2893@bignew s8.bellsouth.ne t...
        >You'll have to show your code.
        >>
        >T
        >>
        >JR wrote:
        >>
        >>>Hi,
        >>>
        >>>I make some menuitems at runtime.
        >>>When the user changes somethings it will be necesairely to change that
        >>>menu. so i use clear to empty the menu and add them all again with the
        >>>new ones.
        >>>
        >>>the first the the menu is fine but after deleting and adding the little
        >>>arrow is in the menu but its not showing the subitems
        >>>
        >>>any idees?
        >>>
        >>>Jan
        >>>
        >>>
        >
        >

        Comment

        Working...