How to toggle the checked property
Hello Agraham,
I've recreated the Menu structure of my SqLite Desktop application with Maimenu.dll. I hoped that it is an easy way to use additional features, like the checked property and have more functionalty.
I have a Main menu called "Abfragen"(querries), that holds some Menufunctions like "Neu"(new),"öffnen"(open),"Ausführen"(run),"löschen"(delete) and the querries that are saved in the database. In german it looks like the attached picture.
Now I want to toggle the checked properties of the menu items that holds the querrynames in it, so that the functions above refer to the choosed querry.
I tried something like this, with no success:
In the Menu Popup event I get the count of menus and save the Items
Sub FEx1Men1_Popup
.
.
.
MenC = FEx1Men1.MenuCount
FEx1Men.SaveMenuItem(FEx1Men1.ControlRef, 2)
.
.
End Sub
If a menu was clicked I select the menu.text.
If it is an enty larger than seven I want to check the selected and uncheck the others.
Case 2
Select FEx1Men1.Text
Case "Neue Abfrage"
Quer.Qer_Start
Case "Abfrage öffnen"
Msgbox("Abfrage öffnen")
Case "Abfrage ausführen"
If EINIT = True AND Conv.EditEx1.Text = "Abfrage" Then
If Conv.TBEdit.Text <> "" Then
SqlStr = Conv.TBEdit.Text
FiNa = AktQer
Conv.EditEx1.Close
If MakeQeryTab(SqlStr, FiNa)= True Then
GetParams(FiNa)
fo.FormGrid_Start
End If
End If
End If
Case "Abfrage speichern"
If EINIT = True Then
cdummy = QIn.Show("Name: ", "Abfrage", "", -1, 30)
AktQer = cdummy
QerText = Conv.TBEdit.Text
MakeQerTab
End If
Case "Abfrage löschen"
QerErase(AktQer)
Case Else
AktQer = FEx1Men1.Text
FEx1Men2.ControlRef = FEx1Men1.ControlRef
For i = 7 To MenC-1 'MenC = MenC = FEx1Men1.MenuCount = 16; 7=begin of querry names
FEx1Men1.ControlRef = FEx1Men1.SavedMenuItem(i)
FEx1Men3.ControlRef = FEx1Men1.ControlRef
FEx1Men3.Checked(False)
Next
FEx1Men2.Checked = True
.
.
.
End Sub
This one try of many but I don't know how to set a not selected Menu Item as the actual Item, to set the property.
Could you help? Or isn't it possible with this DLL?
Best regards
berndgoedecke