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...
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...
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: " &...
I am trying to do what this article suggests:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa965884%28v=vs.85%29.aspx
Here is my code:
Imports Microsoft.Win32
Module Module1
Sub Main()
Dim regKey As RegistryKey
regKey =...
I've migrated from VS2010 to VS2013, and am running into a rather annoying issue. I have a project with 'Register for COM Interop' checked off. Half the time when I rebuild or clean, I get this:
C:\Program Files\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4319,5): warning MSB3061...
This is on the long side because more detail will be more useful than less.
There is a VB6 app which I do not have the source code for. Let's call it "MXE." One of the files included is called called "mxinterface.dll." It defines an interface called "MXPlugin." This interface allows the...
Suppose a database with two tables, "Main" and "Users."
Main:
ID
User1ID
User2ID
1
1
2
Users:
UserID
Name
1
Alice
2
Bob
I've got a SQL statement that looks something like this:
select User1.Name, User2.Name from main
inner join Users as User1 on main.User1ID =...
I have a simple forms app with two buttons. Button "Runas" spawns a child process with admin privileges. Button "Close" closes the form. Here is the entire code:
Public Class Form1
Private Sub B_Runas_Click(sender As System.Object, e As System.EventArgs) Handles B_Runas.Click
Dim...
Is there any way to retrieve another app's "save as" dialog's previous location?
There is a third party program, which uses Windows Common Dialog libraries to save and open files. I want to write something that will read files saved by this program, and to do this I will need to retrieve the...
I'm not an expert on how stream's work in .NET. I have a file that is basically a 7z archive, except the first 667 bytes are in XML. 7zip.exe itself can extract this file just fine.
I am trying to read it using a freeware library called "SharpCompress." It chokes when reading this file. I...
I have code that looks like this:
For Each curFile As FileInfo In fileInfoList
My.Computer.FileSystem.CopyFile(curFile.FullName, destination, UIOption.AllDialogs, UICancelOption.ThrowException)
Next
This works, but it results in showing a series of Windows copy dialogs, each one...
I have a COM dll, which has a class that we'll call "MagicComObject." I have access to its source code, which is VB6, but it is too complicated for me to completely understand. My VB.NET project has a section that looks like this:
Dim iCounter As Integer = GetCounterFromRegistry()...
I have a VB.NET class that looks like this:
Public Interface IBottles
Inherits IEnumerable
End Interface
Public Class Bottles
Implements IBottles
Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Dim...
I'm trying to teach myself how to do stuff in ASP.NET, and I find I learn things best by looking at projects other people have already done, taking them apart, and seeing if I can re-create it.
Specifically, what I'm looking for right now is a web form that connects to a locally-run SQL Server...
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.