|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
submenuitems not openingHi,
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 You'll have to show your code.
T JR wrote: Show quoteHide quote >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 > > > > Sub sMakeLangMenu()
Dim M As MenuItem Dim stext As String mnuLanguages.MenuItems.Clear() Dim di As New System.IO.DirectoryInfo(Application.StartupPath) Me.mnuLanguages.MenuItems.Clear() For Each F As System.IO.FileInfo In di.GetFiles("Lang_??.xml") If F.Name.Length = 11 Then Dim L As New clsLanguage Dim sr As New System.IO.StreamReader(F.FullName) Try Dim xml As New System.Xml.Serialization.XmlSerializer(L.GetType) L = xml.Deserialize(sr) sText = "(" & F.Name.Substring(5, 2) & ") " & L.Language M = Me.mnuLanguages.MenuItems.Add(stext, New EventHandler(AddressOf mnuLanguages_Click)) If F.Name.Substring(5, 2) = Me.Tag Then M.Checked = True M.Visible = True Catch ex As Exception End Try sr.Close() End If Next End Sub Show quoteHide quote "tomb" <t***@technetcenter.com> schreef in bericht news:66X%g.5760$Bs.2893@bignews8.bellsouth.net... > 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 >> >> 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 Show quoteHide quote "JR" <x.x@x.x> schreef in bericht news:AAB0h.152532$aZ2.2552974@phobos.telenet-ops.be... > Sub sMakeLangMenu() > > Dim M As MenuItem > > Dim stext As String > > mnuLanguages.MenuItems.Clear() > > Dim di As New System.IO.DirectoryInfo(Application.StartupPath) > > Me.mnuLanguages.MenuItems.Clear() > > For Each F As System.IO.FileInfo In di.GetFiles("Lang_??.xml") > > If F.Name.Length = 11 Then > > Dim L As New clsLanguage > > Dim sr As New System.IO.StreamReader(F.FullName) > > Try > > Dim xml As New System.Xml.Serialization.XmlSerializer(L.GetType) > > L = xml.Deserialize(sr) > > sText = "(" & F.Name.Substring(5, 2) & ") " & L.Language > > M = Me.mnuLanguages.MenuItems.Add(stext, New EventHandler(AddressOf > mnuLanguages_Click)) > > If F.Name.Substring(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" <t***@technetcenter.com> schreef in bericht > news:66X%g.5760$Bs.2893@bignews8.bellsouth.net... >> 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 >>> >>> > >
Copying from one Database to another VB 2005
Poor performance IDE. Urgent suggestion needed. how to set the Application.ProductVersion resizing controls (webbrowser control) convert text to decimal How to capture Mouse clicks and Keystrokes in a VB app Security and file permissions.... only for expert: what's wrong with this code? System.AccessViolationException Zip SharpZipLib examples for VB |
|||||||||||||||||||||||