Questions tagged [vb.net]

Visual Basic.NET (VB.NET) is a multi-paradigm, managed, type-safe, object-oriented computer programming language. Along with C# and F#, it is one of the main languages targeting the .NET Framework. VB.NET can be viewed as an evolution of Microsoft's Visual Basic 6 (VB6) but implemented on the Microsoft .NET Framework. DO NOT USE this tag for VB6, VBA or VBScript questions.

1
vote
2answers
34 views

VB.Net equivalent for Indexer Initializer

Is there any VB.NET equivalent to the C#6 Indexer Initializer construct? var placesByZip = new Dictionary<string, string> { ["63368"] = "Dardenne Prairie", ["63141"] = "...
0
votes
1answer
21 views

short the code and replace text if equal with something

I want to shorten this code, can it? I will use this code in a timer. that is, briefly, if a Text containing a Q1 to Q infinite Q is displayed, that Q will be replaced with "" nothing, and the ...
0
votes
1answer
24 views

SQL Server Procedure Returning -1

Executing a SQL Server stored procedure through VB.Net The stored procedure execute properly and return value. However, when it is executed through the VB.Net it's returning value -1. Source code ...
0
votes
2answers
18 views

How to read a registry value into a label or msgbox

I just need to read the DWord value in the registry of windows original install date into a label or textbox so that i can use it elsewhere. I am trying to create a countdown using the installdate. ...
-3
votes
0answers
29 views

how to make make tic tac toe game using visual basic

"i want to make player 2 to take over by computer in Tic Tac Toe Game using visual basic language" Private Sub ComputerPlay() 'just trying to make computer to take over the player two but i ...
1
vote
2answers
26 views

Return value gets assigned but always returns as 0

I'm trying to calculate the total count and value of orders for a customer, using the code below. Dim iOrderCount As Integer Dim iLineCount As Integer Dim cTotalGoods As Decimal Dim ...
2
votes
0answers
20 views

Is it possible to implement extension methods on generic interfaced collections in VB.NET?

I can't manage to write a VB.NET extension method which can be called from an object of type ListOfTests in the below solution. I can write the extension method in C# using generic type constraints. ...
0
votes
1answer
14 views

Setting width for multiple columns in a datagridview

I have a datagridview with 13 columns, 10 of which have width = 58, is there any syntax to assign multiple columns? I know this dose not work but is there any thing like, dgv1.Columns[(0),(4),(5),(6)...
0
votes
0answers
15 views

How to run visio-macro on vb.net-application?

I have a visio document which contains macros. I have my own vb.net application which manipulates the visio document by the COM-Interface (Microsoft.Office.Interop.Visio). I want to run a macro of the ...
0
votes
0answers
20 views

Multiple timer thread with single Datagridview

I am using VB.NET with Visual Studio 2017. I am testing a form which has a datagridview. That grid is being populated with initial trading symbols. After loading symbols, I need to press Start button,...
-1
votes
0answers
14 views

Jump link goes to the top of the page in HTML to Word conversion

We are converting HTML to Word doc in Vb.Net and want to use Jump links to jump on specific part of the Word doc. I am using anchor tags for this behavior. But when the user clicks on the link it ...
1
vote
0answers
26 views

Regex Expression: Capture the Text Between the Lines which includes Newline, Spaces, And Underscore characters

I have some text taken from a pdf file and read into a string: ... Fabric Business Of the Cloths 4 Description of the property being purchased ...
1
vote
0answers
21 views

How to change out excel chart data with VB.Net

I am exporting an excel spreadsheet with an app using vb.NET. The rows I want to show on the chart are rows 111, 31, and 6. Row 6 is the x-axis serial number and rows 111 and 31 are y axis values. The ...
0
votes
0answers
18 views

VB.Net AES Encrypted value does not match with http://extranet.cryptomathic.com/aescalc/index

I am writing code in VB.Net to AES encrypt a string of HEX Bytes with 16 in length and expecting the same length result. I found C# code from Microsoft website (https://docs.microsoft.com/en-us/...
0
votes
1answer
38 views

Connection String error on VB net 2008 and MySQL

I try to get some data from MySql using Visual Studio .Net 2008 and on this particular connection string it gives me error that input string was not in a correct format. Imports MySql.Data....
0
votes
1answer
29 views

how to program for a click event of a listbox control when the .name property is unknown at design time

I have an application that has several forms. On one of those forms I have an empty tab control. At runtime, The user enters a string into a textbox. That string is used to create a new tab using that ...
0
votes
0answers
4 views

How to source App.Config Information from the AppDataFolder

I have a problem specific to our new corporate application environment where the entire c: drive has been made read-only. This poses a problem for an application which I intend to port from a Windows ...
0
votes
1answer
13 views

Why does Microsoft Barcode Control break when the workbook is opened via interop?

I have a worksheet, to which I have added a QR code. The QR code is an ActiveX control: Microsoft Barcode Control 14.0 The QR code is linked to a cell (A1), so that when the value in the cell ...
0
votes
0answers
23 views

Show multiple rows in already defined columns of gridview

I have the following gridview: <asp:GridView ID="gvTimeline" ShowHeader="true" runat="server" ShowHeaderWhenEmpty="true" AutoGenerateColumns="false" > <Columns> <asp:...
0
votes
1answer
23 views

Message box error when chosing message box icon vb.net

Okay so the program works fine up until this point. The second yesno message box displays exactly how I want it to with no errors. But i want a seperate message box to display to the user when they ...
0
votes
0answers
12 views

Adding Lots of Columns to DataTable In a Non-List Way?

I have a DataTable I need to hold some calculated factors in, I wish to hold this in a table, then move it all into a DataSet for the 4 seperate results to then export to XML for logging purposes. I ...
0
votes
0answers
8 views

Problem About SystemEvents.SessionSwitch don't invoke

SystemEvents.SessionSwitch this handler didn't invoke when in EXE file but invoke in VS and work TRUE AddHandler SystemEvents.SessionSwitch, AddressOf SystemEvents_SessionSwitch Public Sub ...
0
votes
1answer
35 views

ComboBox On Select Index Changed Event

I have a problem regarding comboxBox. Basically I have two comboBoxs, one is for categories and other is for products. When I select category from first comboBox then it shows products of that ...
-1
votes
1answer
18 views

WPF "Value of type 'Grid' cannot be converted to 'Control'

I am trying to create a Function. One of the parameters is Control (System.Windows.Controls.Control) Some of the controls as Buttons or TextBoxes are acceptable. Although Grid or Images return an ...
-2
votes
0answers
17 views

Illegal character in path in VB.Net

I have the code: If QuestionBox.Text.Contains("#Q1") Then QuestionBox.Text = QuestionBox.Text.Replace("Q1", "") PictureBox.Image = Image.FromFile(My.Application.Info.DirectoryPath + ("\Gfx\...
0
votes
0answers
7 views

WiX - How Can I remove HKCU entries from a perMachine Install

I have an application which needs to be a perMachine install however the application requires to write to HKCU at run-time for configuration specific to the current user. How can I set up my WiX ...
0
votes
0answers
27 views

IF condition not working and no error message

This seems a very strange error.. If lblSoldStatus.Text<>"LIVE" then it correctly redirects: response.redirect("selling.aspx?msgID=3") if lblSoldStatus.Text equals anything else it should excecute ...
0
votes
0answers
11 views

After Button Submit Saving Data And Page Turns To Black With Small square Image at center screen

After Submit Button Click update command is executing and update table with converted bytes value and page turns to black with small white bordered square at center of page. I have tested on 3 to 4 ...
-2
votes
0answers
22 views

May i ask how i can do the code when my store quantity is 0 it will pop a line or message

I am doing a store quantity system now i would like add on a code is when my store quantity become 0 it will pop out a message or link let a user know this store is "out of store" below is a my code ...
1
vote
1answer
28 views

How to remove 0 from front of the numbers in vb.net

Remove the 0s. For ex: 01, 001, 0001, 00001 and so on should become 1 in Textbox either automatically or using a button. Please help!
0
votes
0answers
12 views

VB.NET : How to print the checkbox text and the checkbox state

I new in VB.net programming I am asking if there is a way to print the checkbox itself including the box beside the text and the text itself.Is it possible to print it?If so ,can you share some code?
0
votes
0answers
19 views

System.UriFormatException: 'Invalid URI: The Uri string is too long.'

I am getting the following error when i want to export my repeater control content to a PDF that contains an image: System.UriFormatException: 'Invalid URI: The Uri string is too long.' This is my ...
1
vote
1answer
25 views

How to declare a public variable for a specified user login?

I have a login system that works well, using XML files to store logins, and then I can read the users and passwords, see if it matches, if it does, move to the next form, if it doesn't, error message. ...
0
votes
1answer
38 views

How to fix not showing any data using while loop in php

I am rather new in PHP and MYSQL, I am trying to fetch all the rows in the database which have not been updated (or received) in the status column. This code snippet works perfectly when fetching ...
0
votes
2answers
14 views

How to filter out c-type comments with regex? [duplicate]

I'm trying to filter out "c-style" comments in a line so i'm only left with the words (or actual code). This is what i have so far: demo regex: \/\*[^\/]*[^\*]*\*\/ text: /* 1111 */ one /*2222*/...
1
vote
1answer
32 views

How to check the controls (display name and type) in the GroupBox by recursion and display on 1 datagridview?

How to read controller properties, automatically added to a table assigned to 1 dataGridview? Dim dt As DataTable = New DataTable dt.Columns.Add("Name") dt.Columns.Add("Type") Dim n ...
0
votes
0answers
11 views

What Is The Proper Way To Use SSH Commands In Chilkat

I am using chilkats others libraries like HTTP, FTP, JSON etc etc. but i am not very good at SSH, so currently using SSH through putty (plink) for automation. but using system.diagnostic.process to ...
0
votes
1answer
28 views

short the code if a text equal with something and replace

I make a little game, and i am just beginner. Can you help for short that's code :D My code is too long, and write and write again if want more. Thanks. If QuestionBox.Text.Contains("#Q1") Then ...
0
votes
0answers
23 views

Get all the event-handlers of a event declared in a custom user-control

I'm trying to write a universal function that, given a reference to a control/component and the name of an event declared on its class, it should be able to retrieve (through Reflection) all the event-...
-3
votes
0answers
47 views

Can't Create Global Variables in Visual Basic Windows Form Application [on hold]

Can't Create Global Variables in Visual Basic Windows Form Application.I've tried creating a class and module and using "Public Shared Test As String = ""' But every time I try to write to the ...
0
votes
0answers
13 views

Windows service callback issue

This is hard to explain, but hopefully it makes sense. I have developed a windows service in VB.NET that acts as a socket server. It is using a library where all the functions in this library have ...
0
votes
0answers
28 views

Wait for a thread to finish before passing the value

I am coding a telegram bot that can search Wikipedia with telegram api and vb.net. If someone sends a message saying "wiki xyz" (telegram api, Onmessage)bot gives info about xyz. The problem is about ...
-1
votes
0answers
24 views

Import Excel / Array data to a database

I'm writing a code in VB to have a company site with updated employee information. My goal was to: collect certain data from an Excel file Save the data into an 2D Array Update the array data into ...
-4
votes
1answer
87 views

Convert Double in “d HH:mm” [on hold]

I have a formula that generates a table of 100 rows and 4 columns, the last column returns me certain numbers of hours, I wanted this value to be expressed as "d HH: mm" I try Timespan, but don't ...
-1
votes
1answer
11 views

WPF VB.NET Frame get result from Page

I have an app with the main window's main and only control a Frame. Now I have several pages which am navigating through using the frame's source property. But now what I want to achieve is if a page ...
0
votes
1answer
14 views

regular expression allow only one specific special character and numbers in asp.net vb

i want to get interest value from users through asp.net textbox. it accepts numbers and optional to enter "%" only. prohibit to enter any other special characters or any alphabet letters. ...
0
votes
0answers
19 views

User not recognized as logged in when application is run as Start Without Debugging, user authentication works perfectly when run as Start Debugging

I've built a small ASP.NET web application in Visual Studio 2019, starting from the ASP.NET MVC web application project template for VB, which uses the default Individual User Accounts for ...
0
votes
2answers
31 views

Proper Interface (Implements) syntax for class method with signature (Of T As Class)() As T

I have a hard time to either figure out the correct interface or actual implementation signature/syntax for a method. The method itself works as expected, the compiler at least doesn't complain about ...
0
votes
2answers
40 views

How to remove a single instance from a NameValueCollection?

Assuming the following url: Dim nvc As NameValueCollection = HttpUtility.ParseQueryString(http://localhost/Index.aspx?A=23&A=7&A=1) How can I remove a specific instance of A from a ...
0
votes
1answer
23 views

Minimal binding TextBlock to property

It's been sometime since I coded something in XAML, and, trying to update an old app, I stopped at an issue with binding. I stripped everything to come up to a minimal example. Here is my XAML body: ...