Yeah, I've got it working like I want it by including Me.Hide in the form loader.
I did try that approach of not using the application framework, but I want to do stuff like have the application close when you close the form, and it already does that. Easier just to put Me.Hide in the form...
If I don't do this, then it will show up when I Alt+Tab. I don't want that.
Maybe not. How would I go about starting the application without the form? Under my application settings, the "Startup form" field is mandatory.
Which are the three?
I think I got it working as I want it, but I needed code in the load handler and the designer. In the designer, I set these properties on the form:
ShowInTaskbar=False
WindowState=Minimized
And in Form1_Load, I changed the last line to this:
Me.Hide()
If I don't do that...
I wrote an application that by design, when minimized, goes to the tray, and will only show up as a normal form when you doubleclick the icon in the tray.
To do this, I added a NotifyIcon, and added these functions:
Private Sub Form1_Resize(sender As System.Object, e As System.EventArgs)...
This isn't really a VB question, more of an XML question.
Suppose this XML document:
<Root>
<Gender>Male</Gender>
<Name>Bill Gates</Name>
<BirthName>William Gates</BirthName>
</Root>
And this one:
<Root>
<Gender>Female</Gender>
<Name>Melinda Gates</Name>
<BirthName>Melinda Ann...
Given this code:
Public Class Foo
Property thing1 As String
Property thing2 As String
Property thing3 As String
Property thing4 As String
Property thing5 As String
End Class
Sub Main()
Dim s as String = ""
Dim l As List(Of...
I went and added an XPath walker anyway.
Dim t() As String = address.Split({"/"}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To t.Length - 1
Dim nodeToCheck As String = ""
Dim nodeToAdd As String = t(i)
For j As Integer...
Take this XML element:
<root>
<Alice>
<HiredDate>1/1/2016</HiredDate>
</Alice>
</root>
And this code - myXe is type "XElement":
dim address as string = "/root/Alice/HiredDate"
dim value as string = "2/1/2016"
myXe.XPathSelectElement(address).Value = value
The first two lines simulate...
Take this sample code:
Dim sXml As String = "<n1 xmlns=" & ControlChars.Quote & "n2" & ControlChars.Quote & "><n3>n4</n3></n1>"
Dim address As String = "n1/n3"
Dim xDoc As New XmlDocument
xDoc.LoadXml(sXml)
Dim xNsmgr As New...
This is the first time I've heard of an assembly being loaded from a byte array, and not from a DLL file.
If this is the case, is there any way to retrieve this assembly's metadata? Or am I at a dead end?
Thanks, that worked!
I made some headway on the REAL problem, but ran into a new roadblock.
I ran this code:
Dim a As Func(Of Object, Object) = AddressOf MysteryFunction
Dim mi As MethodInfo = a.Method
msgbox(mi.DeclaringType.FullName)
msgbox(mi.ReflectedType.Assembly.Location)...
Thanks, that worked for Console.Readline. What about MsgBox? I'm getting stumped on this one.
MsgBox has this signature:
Public Function MsgBox(Prompt As Object, Optional Buttons As Microsoft.VisualBasic.MsgBoxStyle = OkOnly, Optional Title As Object = Nothing) As...
Found something that works sometimes, but not always.
This:
Dim a As Action = AddressOf Console.WriteLine
Dim mi As MethodInfo = a.Method
Console.WriteLine(mi.DeclaringType.FullName)
Console.WriteLine(mi.ReflectedType.Assembly.Location)
Will output this...
Take this code:
Dim s As String = Foo(AddressOf MsgBox)
Console.WriteLine(s)
I would like this to print information about the method.
This would be good output:
Member of Microsoft.VisualBasic.Interaction
This would be even better output:
Assembly Microsoft.VisualBasic...
I have a table, like this:
Thing
Category
Apple
Food
Bill Gates
People
Bread
Food
Chai Tea
Edibles
Dreamcast
Electronics
Edibles
Everything
Electronics
Everything
FireTV Stick
Electronics
Food
Edibles
People
Everything
Rocks
Everything
I want to...
My app has a memory leak. As a first step, I've inserted this line into the main loop:
Dim c As Process = Process.GetCurrentProcess()
Dim s As String = "Mem: " & c.WorkingSet64 / 1024 & " K " & _
"VM: " & c.PagedMemorySize64 / 1024 & " K " & _
"GC: " &...
...True)
regKey.CreateSubKey("myApp")
regKey.Close()
End Sub
End Module
I am using Windows 7 Pro, x86.
I actually *do* want to use registry virtualizing here. If my program is run without admin privileges, it should go here...
Not even possible. I can create a brand new library project, set it to "Register for COM Interop," build, then rebuild and get that error message. No program could possibly be referencing it, because I created it ten seconds ago.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.