- 0
[VB.NET] Starting with a form and without
Asked by
ProclaimDragon,
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By eiffel_g · Posted
Guys, you should find another way to promote your deals... It's the third article in the last months that promote this deal for an upgrade from 10. Considering that upgrade from 10 to 11 is free it's a total non-sense. -
By bledd · Posted
Store should be a shrine of useful applications, vetted and verified. Easily sorted by publisher. Windows should start with not much installed and have things as options in the store. Not the wild west mess that it is. You could delete 95%+ of the crap on there and no one would notice. They need to add a better UI to the updates, it's awful right now. -
By David Uzondu · Posted
Obsidian 1.9.2 brings breaking changes, UI improvements and several bug fixes by David Uzondu Obsidian 1.9.2 (Desktop) is now live, bringing some significant updates, especially if you have been using the Bases feature. If you're not familiar with Markdown, it's a simple way to write formatted text using a plain text editor; Obsidian is a free editor that lets you create and link notes using Markdown files stored right on your own computer. Obsidian is free to use, but if you support the project with a Catalyst license, you get access to early builds. Version 1.9.2 is in Early Access right now, so you'll need a Catalyst license to try it out This new version introduces some major breaking changes to Bases, so you'll want to pay attention here. The developers have overhauled the formula syntax and the .base file format itself. If you're using Obsidian Sync or sharing your vault across multiple devices, the team strongly recommends upgrading all your devices at the same time to dodge any annoying sync issues with files using different syntaxes. The new formula syntax in Bases is designed to be more flexible and easier to use, and it should feel familiar if you code in JavaScript. For instance, functions are now object-oriented; instead of writing contains(file.name, "Books"), you would now use file.name.contains("Booksou can also chain functions together, like property.split(' ').sort()[0].lower(). Other highlights include: Property names are no longer wrapped in backticks (`). Instead, to reference properties with spaces or special characters, the syntax is note["Property Name"] There is a new type system which provides greater control when writing formulas. New functions, such as link, date and list for converting a value to a different type. New file properties: file.path, file.links (a list of all internal links in this file), and file.tags (a list of all tags in this file, including frontmatter). Some functions have been replaced by comparison operators. For example, dateBefore(date1, date2) is now date1 < date2. Date modifications are now much simpler. Instead of dateModify(date, string), you can use date + string, for example, date("01/01/2025") + "1 year" For those wondering, the Bases feature was introduced back in Obsidian 1.9.0 as a way to turn notes into structured databases. You can learn more about the updated syntax here. Alongside these syntax changes, the .base file format has been updated for better extensibility, including a new properties section for configurations like displayName. There are some smaller improvements too, like Bases now showing the number of results in the current view and the operator dropdown for filters becoming searchable. Outside of Bases, the update brings fixes for the following: Tags view: Fixed "Show nested tags" showing the full tag name (e.g. #parent/child) File explorer: Fixed "Move folder to..." menu item not showing in context menu. Bases: Fixed view not closing after deleting the file. Bases: Fixed codeblock not rendering when "Indent with tabs" is enabled. On a related note, the creator of Markdown, John Gruber, recently shared his thoughts on rumors about Apple Notes potentially adding Markdown export. While he had reservations about Apple Notes becoming a full-blown Markdown editor, he seemed to think an export option would be useful. If the rumors are true, users will be able to easily export notes from Apple Notes and edit them in editors like Obsidian. -
By gft77 · Posted
Firefox with uBlock Origin is better IMO. -
By datacenter · Posted
1. DRM is the worst plague, I like my games clean. 2. Third party launchers are an overhead and annoyance.
-
-
Recent Achievements
-
Uranus_enjoyer earned a badge
First Post
-
Uranus_enjoyer earned a badge
Week One Done
-
jfam earned a badge
Week One Done
-
survivor303 earned a badge
First Post
-
CHUNWEI 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