Anonymous
Anonymous

Reputation: 1

ListBox populate using VB.NET

I have a system. I want to make an access configuration page for my system. The system contain of main menu and sub menu. What I want to do is. If the selected menu is open the access, the sub menu under that main menu also will open access. If the selected menu is close, the sub menu also close the access. The access can be open and close by the user. I want to display it in a list box, meaning that I have open and close list box for main menu and also open and close list box for sub menu. so if let say, the menu under open access I can change it to close access. And when I change it, the sub menu also automatically change. The changes will require to have a temporary value since the user not clicking button save, thus the value will need to be hold first until the user click on save button. I'm using ASP.NET and visual basic. Help me with the code. This is code.aspx :

<div class="form-group" id="Modul" runat="server" visible="false">
    <div class="form-group" id="snippet1Content" runat="server" visible="true">
         <label class="col-md-3 control-label"></label>
         <div class="col-md-4">
             <label>Dikunci</label>
             <asp:ListBox ID="Dikunci" runat="server" Width="300px" Height="170px"
                          AutoPostBack="True"  SelectionMode="Multiple" onchange="updateSubMenuList()"></asp:ListBox>
             <div>
                 <label>Dikunci</label>
                 <asp:ListBox ID="Dikunci1" runat="server" Width="300px" Height="170px" 
                              AutoPostBack="True" SelectionMode="Multiple" onchange="updateSubMenuList()"></asp:ListBox>
             </div>
         </div>
         <div class="col-md-4">
             <label>Dibuka</label>
             <asp:ListBox ID="Dibuka" runat="server" Width="300px" Height="170px" 
                          AutoPostBack="True"  SelectionMode="Multiple" onchange="updateSubMenuList()"></asp:ListBox>
             <div>
                 <label>Dibuka</label>
                 <asp:ListBox ID="Dibuka1" runat="server" Width="300px" Height="170px"
                              AutoPostBack="True" SelectionMode="Multiple" onchange="updateSubMenuList()"></asp:ListBox>
             </div>
         </div>
     </div>
     <div class="col-md-offset-3 col-md-9" id="panel_btnAll" runat="server" visible="true">
         <asp:Button runat="server" ID="btnSimpan" Text="Simpan" class="fa fa-check" CssClass="btn green" />
         <asp:Button runat="server" ID="btnBatal" Text="Batal"  CssClass="btn red" />
     </div>
</div>

Upvotes: 0

Views: 117

Answers (1)

Albert D. Kallal
Albert D. Kallal

Reputation: 49309

Ok, so there are quite a few ways to build a menu system.

One of the easiest is to create a new project, and use one of the templates. The result is a "menu" system that is scaffolded out for you, and in most cases, even with little knowledge, you can add/change the menu system.

Another way?

Just drag from the toolbox into the form a menu item.

Then, choose the edit items, and you can then use a GUI to build together a menu for you.

So, it looks like this:

enter image description here

And when run, it looks like this:

enter image description here

So, using a menu item is likely a better start.

Of course, the other approach is to create a template, and thus you have/get a master page menu like this:

enter image description here

So, these menu systems have options such as cascading menus, and drill downs. Thus, I don't think it all that great of an idea to try and use some list box, as they tend to not have built in features that "auto expand" on hover like typical menus do, and are designed to work that way.

You can certainly place a few "list box" on a form, and say have them "cascade" from the previous listbox selection. However, such listboxes will not "automatic" expand on hover, but only say on you having clicked on a listbox.

So, you can certainly "cascade" list boxes like say this:

enter image description here

So, list boxes can be used to "cascade" based on the previous value, but they will not "auto expand" when you hover such menus. Hence, using a "menu" control, or even the main menu bar (bootstrap) tends to be a far better choice for menus that auto expand on hover of the menu.

Upvotes: 0

Related Questions