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:
And this one:
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
Dim s as String = ""
Dim l As List(Of...
Take this XML element:
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
Dim xNsmgr As New...
Take this code:
Dim s As String = Foo(AddressOf MsgBox)
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:
I have a table, like this:
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:
Here is my code:
Dim regKey As RegistryKey
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."
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
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)
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
Public Class Bottles
Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
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...