Visual Basic.NET





Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

I work in a VB.Net shop. The branch of the company I work for odes a great deal of mailing and as such use IMB Barcoding. We need to use a dll provided by USPS and from everything I have found in my research it is not compatible with Visual Basic, .NET or otherwise. The dll provided by USPS is USPS4CB.dll, which was written in C.

I refuse to believe that some great mind out there hasn't found a way to access the dll and use its functions. I have found some references in my research to a compatible version of the dll that was provided to someone by USPS, but have no way of obtaining it.
I either need to figure out either how to import and use the dll in VB.Net or how to obtain a compatible version of the dll.
I am trying to access a particular website using a app and a WebBrowser component in that app.

I want to click a link on the page, which uses JavaScript and failed to do so programatically. It was then that I discovered that even when clicking the link directly with the mouse it does not work. The links work fine in conventional web browsers, but not in the WebBrowser component.

I have no control over the destination website.

The HTML for the link in question is:

<a href="javascript:;" class="ellipsis" onclick="fn_detailView('0095000', '00010', '20190315', '1')">(주)유한양행</a>

Is there a way I can "fix" the WebBrowser component with respect to this website, or can I directly call the JavaScript function specified in the link?
How do I easily passing information from a database to  model and then to the view without using binding, i am using mvc 4.0
How do I allow users of my application developed in VB.NET to send email using the application?

The application generates an invoice, I would want the user to send that invoice through the application and using his email account as a form address.

Thank you, Anthony
I am using Visual Studio 2008 for developing a project in VB.NET .  I have built a report using crystal reports (in Visual Studio 2008) in the project which contains Barcode.  I had assigned code 128 AB Tall as the font but when I try to export it to PDF it generates ERROR.  I then tried the font Code 128, this time it got exported to PDF correctly but when I tried to read the barcode through barcode scanner, it won't get read.

I shall appreciate Insights to resolve the above situation.

P.S : I am attaching the snapshot the the error I am encountering during the export.

I am using Treeview in with VB, I am using tabs and in one of tab, treeview is binded, When I select treeview node item then it gets focus and scrolled so it's visible in treeview, When I change tab and come back on treeview tab then last selected node remain selected but focus don't come, is there anyone to find selected node and set focus into that? How to get focus on Treeview node. Please help.
From the reading pane of Outlook, I would like to quickly copy the contents (body and header) of a highlighted email messages to be able to paste into a work order system.

Is there a way to do this with Quick Steps or would I need a macro?

I can semi-manually do this by hitting Reply then CTRL+A and erasing my signature at the top of the reply, but it gets tedious.
If there is a way to reply without Signature when using the macro/quick step (without changing my signature preferences), that would be ideal.

Looking at integrating a application to pull orders from a web API. In the past I have added a reference and used the WSDL. The software I am trying to integrate is:

It would be better if I could use a WSDL type integration but from the documentation it looks like you have to do a HTTP request.

Really looking for the best way to move this forward. don't know if I should use the HttpWebRequest.

The documentation says :
# Use the command below to dump the JSON data for your orders. Replace the `2c493d74` with your own API key (which will be much longer)
curl -u 2c493d74:X ""

I am a bit unsure if I keep my httpwebrequest as:        
Dim myRequest As HttpWebRequest = CType(WebRequest.Create(""), HttpWebRequest)

If I try and anything else it fails. I can call myRequest.Credentials but is this what I should be trying to do?

Best Regarsd,

I am using infragistic Web datagrid with .
I need to drag and drop grid rows in same grid.

Please provide solutions
I am new to mvc and started a project to track insurance polices for horses. I have the basic forms to enter the owners and horses but i am having trouble with the many to one and many to many relationships while trying to enter them with forms.

I have a form creating an insurance policy but I'm not sure how to add the owner to that policy and then select some or all of the horses that owner has to add to the policy. I was thinking of having a popup to select the owner and then after that is selected have another popup to select at add the horses.

If anyone has examples of how to do that I would appreciate it.

Hello EE,

In, I have a dictionary(Of Date, String).
Looks like this :

01/01/2018         Robert
01/02/2018         Steve
01/03/2018         Jenny
01/04/2018        Paul
01/05/2018        Veronica
03/11/2019         Jenny

Open in new window

With this, in marketing we have some code that, if let's say as of now, if Jenny still was not picked up with our system, she will be in a list like this :

Jenny  - 90 days
robert - 56 days
Phil - 42 days
Catherine - 41 days

Open in new window

meaning, its been 90 days that Jenny was not picked up by our system in marketing.
if tomorrow she gets picked up, she will be removed from the list and if the others were not picked, it will go like this :

robert - 57 days
Phil - 43 days
Catherine - 42 days

Open in new window

so Jenny is not in that dictionary(Of string, Integer) any more, but the others are and their days has been increased by one.

so all this works well.

My question is :   If I would like to check the history and the past, "who was picked up every week for the whole year", without manually writing it on a paper, how can I do it in ?
You see, we keep everything in the first dictionary I showed on top. the dictionary (Of Date, String) I have all the picks.

I would like to retrieve in the past, by week who was picked
so maybe in one week there is just 1 .. maybe in one week there are 3..
Because when it picks days goes to "zero" I have a hard time in, linq, and so forth, to do a function that goes back in time and read all this

can you help ?
Hi there, I need to write a function that finds and formats text in a RichTextBox. So for example in the context "This is bold type a test normal type. This is the italics second test normal type" would output like: "This is a test. This is the second test". The output would be in the same or another RichTextBox displaying the specified text in bold, italics, etc. Thank you.
I want to write a Windows program that always occupies the top quarter of the screen (I want it permanently displayed so users see important messages).
If other windows programs are maximized, they should not cover my vb program. Other programs should behave as if  the screen starts below my vb program.

i hope I have explained clearly !

I have 2 very similar VB.NET applications.  They are both Windows Forms applications, and both have some "maximized" forms and some "windowed" forms.  They are deployed to Windows 7 PC's with monitors set at 1280x800 at 125%.  

One application  sizes properly -- All forms and controls in the app size "up" properly, and all fonts size up properly.  The second application seems to size up the fonts, but not the controls or the forms themselves.  There is a form in both apps sized 450 x 500 -- One displays larger than the other at 125%.  After switching the monitor to 100%, both those forms show at the same size.

These applications are created using VS 2017 "Community".   I have checked the properties of those two forms, and they are the same.   However, since I see the problem on all forms, I am assuming it is a setting at the application level, not the form level.   In both apps, the "Enable XP visual styles" is set the same, and that's the only setting I see that may be related to how forms are displayed.

This may or may not be a clue (and I have to verify it), but when running at 125% on a Windows 10 machine, both applications size properly.

Any ideas what setting I need to change to fix this?
Hi All

The below script deletes all contact objects in outlook where the mileage attribute = 500. Is there any way to add a condition to the script to prevent the contact from being deleted if it has any additional email addresses configured e.g. do not delete if a contact where mileage = 500 but has either email 2 or email 3 configured

Dim objOutlook
Dim objNamespace
Dim objFolder
Dim objItem
Dim objRecord

Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNameSpace.GetDefaultFolder(10)
Set objItem = objFolder.Items
Set objRecord = objItem.Find("[Mileage] = ""500""")

While Not objRecord Is Nothing
	If objRecord.Body = "" Then objRecord.Delete
	Set objRecord = objItem.FindNext


Set objRecord = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set objNamespace = Nothing
Set objOutlook = Nothing

Open in new window

Hide row and column headers from VB Addin, and other viewproperties

I have googled this very deeply, checked the object browser in VS2017. I could come up with something like this below:

There is the worksheetview object, that has the prop DisplayHeadings.

The samples are all VBA, when i use it in the addin, the intelisense will give me wsvw.DisplayHeadings, but I will then receive a runtime error.

QUESTION: how can i use a worksheetview on a single worksheet in VB to modify the view and other properties

                Dim wnd As Window
                Dim wsvw As WorksheetView
                For Each wsvw In wnd     'AddinModule.Checklistworkbook.Worksheets
                    MsgBox(wsvw.DisplayHeadings.ToString & " - " & wsvw.Sheet.ToString)
                Next wsvw

Open in new window

Hi all

Is it possible with vb script to achieve the following:

if I have two sub folders in outlook for contacts e.g. ‘sub folder 1’ and ‘sub folder 2’. If there is a duplicate contact found in each folder (matched by email address) is there a way to copy one particular attribute from one to the other. The idea being that we want to collapse ‘sub folder 1’ But ensure we copy all information in the notes field to the same contact found in ‘sub folder 2’ before we delete ‘sub folder 1’.
How to reorder excel sheets in, I've seen some examples on the net but I can't get the 'after' property set. I can add multiple sheets(45) but the order is from last to first, and I need it from first to last.
I've borrowed the code from the net.

Dim objApp As Excel.Application
        Dim objBook As Excel._Workbook
        Dim objBooks As Excel.Workbooks
        Dim objSheets As Excel.Sheets
        Dim objSheet As Excel._Worksheet
        Dim objSheet2 As Excel._Worksheet
        Dim range As Excel.Range
        Dim rangeSheet2 As Excel.Range

        Dim strExcelDataArray As String(,)
        Dim strExcelDataArray2 As String(,)
        Dim misValue As Object = Reflection.Missing.Value

            ' Create a new instance of Excel and start a new workbook.
            objApp = New Excel.Application()
            objBooks = objApp.Workbooks
            objBook = objBooks.Add(misValue)
         [b][u] objBook.Sheets.Add(, , strListOfPartNumberPrefixes.Length) [/u][/b]
            objSheets = objBook.Worksheets
            objSheet = objSheets("Sheet1")

Open in new window

when I courser over 'objBook.Sheets.Add(, , strListOfPartNumberPrefixes.Length)'  it indicates the the second parameter is the after setting but I'm not sure what to insert.

Thanks in advance.
dear all
i have a  application where i am using a sqldataadapter with insert command and select command
in order to fill the data and to update the data
after processing only 7 entries we hit 1.7 GB of memory usage; the more processes initiated the higher the accumulated RAM usage s.
the CPU and RAM usage tend to rise.
the memory in task manager  continues to rise with each and every executed command. After executing say 20 tasks it’s not uncommon to see RAM usage alone consume 1 GB of memory.please help how can i solve this issue
I have many G-Code files and I want to create a gallery like c# application that shows the previews/thumbnails of the G Code files.
In short: I want a G-Code to Image converter.

Can someone give me some direction?
Or can someone give me a source code from where can I start?

Thanks advanced
How can I double click on a text box and copy the contents in Visual Basic. And please make your answer understandable and complete so I will be able to use it on my web site.
Thank you very much for any help you can give me.
Conversion from string " " to type 'Integer' is not valid.'

Dim lines() As String
        Dim file As String
        file = "C:\Files\file.txt" 
        Dim sr As New StreamReader(file) 

        lines = sr.ReadLine().Split(vbTab) 

        For Each line In lines

            staffName(line) = lines(0)
            StaffNo(line) = lines(1)


Open in new window

I am trying to create a simple outlook addin that reads and writes to the ribbon bar. I have bought the addin express tool, but somehow the addin has some tweaks, since it does not react like the normal VBA with events etc.

I am looking for a sample that would achieve the following,

in this sample i need to see how i can read and write values from a ribbon bar element, in one seperate class (in the addin express it only lets me call events in the main Addin class, i would like to have the call run in a seperate class)

in the sample, i would like to react to an event from an outlook ribbon item in one sperate class - SO i have a Event that gets triggered in a seperate class, so i dont fill up my base calss where the addinmodule resides

SO ia solution that does the following:
the element in the ribbon should be a drop down list,
In the ribbon add a button, when clicked it will read the value from the drop down box and trigger a sub in a seperate class file, than the addinmodule
Im looking for a way with VB.NET or something similar to keep a particular webpage refreshing in the users chosen web browser on a timer to basically prevent a timeout where they got logged out and are required to log back in to a web portal from an external provider. Is there a way to tell a web browser application to refresh a tab externally either by the url or the name of the tab ? Im thinking that using a vb app to browse the website wouldn't work because its outside the browsers context where the user authenticated and would not achieve what im after. Any ideas or a completely different approach maybe ?
I would like to add a filter for a Gridview Control in VB.Net 2012.  What is the best solution in doing this?

Thank you!

Visual Basic.NET





Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,