- 0
[VB.NET] Starting with a form and without
Asked by
ProclaimDragon,
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Tuskd · Posted
They did remove the Start button with Windows 8, but everyone had their pitchforks out. That OS had its many issues, but you could work on a desktop environment without the Start. Safe to say not many liked it. -
By ThaCrip · Posted
I always just assumed that how I start programs is pretty close to how most people do it, which is... 1)Either start a program from desktop icon. or... 2)Windows key (or mouse click on start menu) and when start menu appears type in a little of what program you are trying to find, it will highlight, then press enter (or find it with mouse pointer and click it) is the very basic idea. this is very basic core functionality I would never change since it's quick and to the point and just works and has been this way a long time now. NOTE: I am on Linux Mint 22.1-Xfce (I am using the 'dark' menu since the default light grey is a bit out of place with the rest of Mint's darker look), but the very basics like this are the same as Windows in this regard. I like how Mint tends to pretty much stay the same (minor tweaks from point release to point release that are slight but overall it's pretty much the same) instead of change for the sake of change like Windows does and ends up making some stuff potentially worse as a result. I say screw all of those trends where something has to 'look current' as I am more of the mindset once something looks good enough, which Mint does (along with say Windows 7's core interface and the like), you don't screw with it as if someone does want to mess with it, they can do their own custom tweaks on the side, but the base install should be like that 'old faithful' type of interface that everyone has been familiar with for decades now. so by that standard the 'Start Menu' is still useful. I would NEVER get rid of that core functionality as Win8 pretty much tried that upon release and it made doing VERY basic stuff a chore which is why after I briefly tried Win8 in a VM, I never bothered with that OS again as that was easily Microsoft's biggest mess up with interface changes and I have been using Windows since v3.11 in mid-1990's and that Win8 interface change was by far the biggest mess up from Microsoft (how that made it to the final product is beyond me). I realize they supposedly fixed it in Win 8.1, but by then no one really cared as Win7 was the standard and those moving on from that went to Win10. -
By +Warwagon · Posted
i click a few things on the start menu, other wise I do still use the run box daily. -
By Islander · Posted
That article title has a typo, it's supposed to say "Do I even need it?" And... I would not have wasted time writing a full article on a software [or feature] analysis based on exactly 1 user experience. -
By M. Murcek · Posted
Lots of people use it without having an angsty Gotterdammerung.
-
-
Recent Achievements
-
Wayne Robinson earned a badge
Week One Done
-
Karan Khanna earned a badge
One Month Later
-
Karan Khanna earned a badge
Week One Done
-
MikeK13 earned a badge
First Post
-
OHI Accounting earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
ProclaimDragon
Suppose I have Form1 and there's only 1 button in there (Button1) and I start my application through a Public Sub Main() in Module 1. Then, in Module 1 I have the fomr variable declared this way: Dim frmMain as New Form1; and inside the Sub Main() I have: Application.Run(frmMain). If I have the frmMain inside the Run(), the form will show, if I don't, no form will be shown. And no matter if I have something inside Run() or not, the code will notcontinue after that point unless some function is called from some button, menu or something... I mean:
Public Sub Main() Application.Run(frmMain) Debug.WriteLine("Test") ' This line won't be processed... End Sub
Also, on the Module 1 I have some function like:
It doesn't matter what's inside, it's just a function I need to use.
I need to call this function when I click the Button1; no problem with that, it's easy. Now... My application can be accessed with 1 parameter or not and this is my problem. Not reading parameters, cause for that I use the following code:
(also in Module1 declarations I have: Dim MonSwitch as Boolean)
I only need this (/monitor) parameter, so, if the application is executed normally, without any parameters, I want it to run as usual and show Form1 but if the parameter is found (MonSwitch = True) I want the application to run normally but without showing the form and after all that, I want to call Function1.
I can't find a way to make it work...
The contentes of my Function1 are:
Public Sub Function1() ' Make MainForm as invisible frmMain.ShowInTaskbar = False frmMain.Hide() ' Put icon in the notification area? If (frmMain.CheckIcon.Checked = True) Then frmMain.NotifyIcon.Visible = True End If End Sub
Because this code will be called at start (if /monitor is in the parameters) or when I press button1. As you can see, I have a NotifyIcon wich has visible property set to false in the design view and I set it to False when I press Button1 or I start the app with /monitor, wich means I don't want to show Form, I just want the app to rest on the notification area monitoring some files (that's what I want to do).
Basically, I want the app to start hidden and start monitor some files if the parameter /monitor is there, if it's not, show Form1 with all the settings about what to monitor and Button1 is to save the settings and start monitor.
Any help? Can't make all this mess work...
Link to comment
https://www.neowin.net/forum/topic/269846-vbnet-starting-with-a-form-and-without/Share on other sites
19 answers to this question
Recommended Posts