Home All Groups Group Topic Archive Search About

submenuitems not opening

Author
26 Oct 2006 4:14 AM
JR
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

Author
26 Oct 2006 4:44 AM
tomb
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
>
>

>
Author
28 Oct 2006 5:07 AM
JR
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
>>
>>
Author
28 Oct 2006 5:58 AM
JR
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
>>>
>>>
>
>