In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use VB. NET history menu, has a certain reference value, interested friends can refer to, I hope you read this article after a great harvest, the following let Xiaobian take you to understand.
History menu is used in many software. If you don't know what history menu is, please open the "file" menu in your word. You will find many used file names in the file menu. These are called history menus, and they keep track of the files you've used--file names, file addresses. But instead of saving all used files, it saves only a few, updating the oldest file automatically whenever a new file is opened. The advantage is that it can quickly open files that have not been edited the last time or the last few times, or that need to be used again. After knowing what is the history menu, you can write a history menu and put it into our program.
Set up a scheme in VB. NET history menu, then add an openfiledialog control, a button control, a mainmenu control, where mainmenu control is a menu control, and set up 5 submenus below it. Set the Visible property to false for all 5 submenus. The Text property is set to null. Then add the following code. (code written by vb.net)
Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim st As String OpenFileDialog1.ShowDialog() End Sub Private Sub OpenFileDialog1_FileOk (ByVal sender As System.Object, ByVal e As System.ComponentModel. CancelEventArgs) Handles OpenFile Dialog1.FileOk 'Please note that MenuItem1 is the main menu item, So the submenu items start with MenuItem2. Dim stfilename As String stfilename = OpenFileDialog1.FileName If MenuItem5.Text "" Then MenuItem6.Text = MenuItem5.Text MenuItem5.Text = MenuItem4.Text MenuItem6.Visible = True End If If MenuItem4.Text "" Then MenuItem5.Text = MenuItem4.Text MenuItem4.Text = MenuItem3.Text MenuItem5.Visible = True End If If MenuItem3.Text "" Then MenuItem4.Text = MenuItem3.Text MenuItem3.Text = MenuItem2.Text MenuItem4.Visible = True End If If MenuItem2.Text "" Then MenuItem3.Text = MenuItem2.Text MenuItem3.Visible = True End If MenuItem2.Text = stfielname MenuItem2.Visible = True End Sub
Visible is set to false and text is set to blank at the beginning of the VB. NET history menu so that menu items without file names are not displayed. Button1 is used to open the file dialog basket. OpenFileDialog1_FileOk is a statement indicating what is to be executed when the OK button of the file dialog basket is pressed.
Thank you for reading this article carefully. I hope that the article "How to use VB. NET history menu" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it more, pay attention to the industry information channel, and more relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.