/r/visualbasic
A place to discuss, ask questions and share ideas regarding the Visual Basic programming languages.
/r/VisualBasic - A place to discuss, ask questions and share ideas regarding the Visual Basic programming languages.
/r/visualbasic
I’m supposed to make an array for a soccer team and their scores that auto arranges from the teams with the most wins to least.
Then have a button that shows the scores (I know the button tool but the coding of the function is fuzzy).
However I have zero idea how to make the array, I’ve looked on Google and it’s all gibberish or I’m told to use a tool that I don’t have (for context I’m using 2022 version) let alone the coding associated.
Any help would be appreciated.
While working on a project I've come across a need for a large number of storage to be taken up by meaningless files, so i created a little vb.net project to do that. However I've come to a bottleneck and it's not as efficient as I need it to be (Currently 1GB in 20s), do you guys have any idea on how to improve it. Visual basic express 2010.
I was recently searching for something and found a great article on something related. While reading the comments I found some guy berating, insulting a belittling the article author for using VB.NET. While i currently use c#, i learned .NET using VB, and still like VB. And while I hate Java (from experience using it years ago), I can't imagine myself insulting someone who chooses to use Java. So I was pretty surprised and upset when I saw the comments from that guy, and even more upset when I learned he's a Senior at Microsoft for the past 8 years or so. As a fan of most Microsoft products and focused almost exclusively on the .NET framework and ecosystem, this hit me in a really sour spot. I personally feel developers are usually of a fact driven mindset, and are part of rather small communities in which many are contributors to. I feel these contributors should be thanked for giving without asking in return, and not bullied online. I just wanted to share my thoughts and what prompted my thoughts (see video below). And while my title may be a little misleading, employees of the major companies/players in our industry should be held to a slightly higher standard, in my opinion.
How can i make vb run form 3 first instead of form 1 cant i just rename it or something
Key To Heaven is my VB.Net passion project, a 2D MMORPG that I’ve been working on for almost 20 years. After years of dedication, I’m thrilled to announce that the game is finally complete and ready to launch!
Mark your calendars: on November 29th at 20:00 CET, the game will officially leave Early Access on Steam. Everyone will start fresh at level 1, embarking on this journey together. For me, this marks the beginning of some peace of mind, allowing me to shift my focus to smaller patches.
What’s it made in?
The game is built entirely in VB.NET.
For graphics, I’ve relied on SFML, which has been a great fit for creating the retro aesthetic I envisioned.
Server Architecture
The server system is designed with flexibility in mind:
For custom Realms, players get all the tools they need to tweak game content—like adding new maps, items, monsters, and more. Plus, these custom servers will still show up in the game client’s server list for others to discover.
https://reddit.com/link/1h1betq/video/6444s8dhnh3e1/player
Why play it?
If you love retro-style indie games, Key To Heaven might be right up your alley. It has all the classic MMORPG staples: Randomized gear, crafting, raft, Questing, Raids...
But it also brings some fresh ideas to the table, like:
And there’s much more hidden beneath the surface, plenty to explore and discover as you play.
Website: https://key2heaven.com/
Download: https://store.steampowered.com/app/1347630/Key_To_Heaven/
Discord: https://discord.gg/TmHHJkG
Hi. I used Llama 405b to make vb.net api wrapper for llm-inference chatllm.cpp: JohnClaw/chatllm.vb: VB.NET api wrapper for llm-inference chatllm.cpp
Hello! I have an assignment for class where I need to be able to edit a table in a dataset that is open using the
Datagridview. When I execute the code I wrote nothing happens except the dialogue box pops up confirming a save has happened. Any ideas on how to actually get it to save? here's my code:
Private Sub SaveToolStripButton_Click(sender As Object, e As EventArgs) Handles SaveToolStripButton.Click
Try
Me.Validate()
Me.MeatPartyBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MeatDataSet)
MessageBox.Show("Changes saved successfully!", "Meat Info", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.Message, "Meat info", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
I learned this code from dissecting one of the exercises in the book. the book is Programming with Microsoft Visual Basics 2019/2022 by Dianne Zak
I have in column h multiple names on a table called SYS
I need to keep only which values on column h does not contain David Sama Sught Maria
How can I achieve this ? Thanks
Hi all,
I have 0 experience with VB, but I cobbled this together today using google, stack overflow and chatgpt (I know, please don't hate me) and I managed to get it to work once, and it seemed to work perfectly it did exactly what I wanted, and then I tried to run it again, exact same code, just on a different excel workbook and it now does nothing when I run it. No errors asking me to debug or anything just runs fine but doesn't actually do anything.
Code is meant to take an excel sheet called "Transactions", and then randomly select 10% of the rows and copy them over to the 2nd sheet called "Random" basically got a list of transactions that relate to company spending and want to create a way to just get the transaction report, run the script, then I have 10% of the transactions randomly selected which I can use for spot checking.
Anyone got any ideas? Code below:
Sub RandomLinePicker()
'Define the Start and End of the data range
Const STARTROW As Long = 1
Dim LastRow As Long
LastRow = Sheet1.Cells(Worksheets("Transactions").Rows.Count, 1).End(xlUp).Row
'Create an Array - Length = Number of Rows in the data
Dim RowArr() As Long
ReDim RowArr(STARTROW To LastRow)
'Fill the Array - Each element is a row #
Dim i As Long
For i = LBound(RowArr) To UBound(RowArr)
RowArr(i) = i
Next i
'Shuffle the Row #'s within the Array
Randomize
Dim tmp As Long, RndNum As Long
For i = LBound(RowArr) To UBound(RowArr)
RndNum = WorksheetFunction.Floor((UBound(RowArr) - LBound(RowArr) + 1) * Rnd, 1) + LBound(RowArr)
tmp = RowArr(i)
RowArr(i) = RowArr(RndNum)
RowArr(RndNum) = tmp
Next i
'Calculate the number of rows to divvy up
Const LIMIT As Double = 0.1 '10%
Dim Size As Long
Size = WorksheetFunction.Ceiling((UBound(RowArr) - LBound(RowArr) + 1) * LIMIT, 1)
If Size > UBound(RowArr) Then Size = UBound(RowArr)
'Collect the chosen rows into a range
Dim TargetRows As Range
' Initialize TargetRows as Nothing
Set TargetRows = Nothing
' Assuming RowArr is already populated and Size is correctly calculated
For i = LBound(RowArr) To LBound(RowArr) + Size - 1
If TargetRows Is Nothing Then
Set TargetRows = Sheet1.Rows(RowArr(i))
Else
Set TargetRows = Union(TargetRows, Sheet1.Rows(RowArr(i)))
End If
Next i
'Define the Output Location
Dim OutPutRange As Range
Set OutPutRange = Worksheets("Random").Cells(1, 1) 'Top Left Corner
'Copy the randomly chosen rows to the output location
TargetRows.Copy Destination:=OutPutRange.Resize(TargetRows.Rows.Count).EntireRow
End Sub
Thanks all!
I notices that, VB6/VBA/VBScript have a gotcha in its language design; where subsequent conditions of an if
statement, are evaluated even though they're not supposed to.
For array e.g.:
arr = array(3, 4, 5)
i = ubound(arr) + 5 'beyond array length
if (i < ubound(arr)) and isempty(arr(i)) then
rem above line causes exception
end if
In above code, arr(i)
is not supposed to be evaluated. But it does anyway.
Same thing goes to collection. e.g.:
set fl = createObject("scripting.filesystemobject").getfolder(".").files
i = fl.count + 5 'beyond collection length
if (i < fl.count) and isempty(fl(i)) then
rem above line causes exception
end if
Or object. e.g.:
set x = nothing
if (not (x is nothing)) and isempty(x.prop) then
rem above line causes exception
end if
I already know the workaround for above gotcha, and I'm not asking for other workaround, or any alternative language.
I want to know any other kind of gotcha in VB6/VBA/VBScript.
Hi all - I created a MS Access VBA project that I haven't seen before; a Breakout (aka Arkanoid/Brick Breaker) style clone with the ball, paddle, and bricks. It still has a few bugs, glitches, and weird flickering, but I got it working!
Full code and file here: https://github.com/TLDWTutorials/BreakoutClone
I also made a YouTube video about it as well. See: https://www.youtube.com/watch?v=GLEZmrcn-Vc
Feel free to use it, optimize it, and make it your own.
Hi, My employer upgraded Oracle from 11g to 19c.Now the Oracle forms builder fails to connect to Oracle 19c.RWRUN60 CMD just vanishes once the creds are entered and nothing happens.
Anyone has any experience with this and any suggestions or fixes for this?
Forms builder 6i was earlier connecting to 11g and everything was working fine.
Please let me know if any additional info is needed from my end.
I have no knowledge or experience on VB.So seeking out for help
They thought it has to do with encryption in 19c and altered the sqlnet.ora file to setting LOGON.ENCRYPTION=rejected but dint help
Hi guys! I've made a program for my dad that he can know how many hours he made at job. But I don't know how to transfert my program to a phone. Can you help me? I do so many search and I can't find anything. I think that I can't do this, so please don't juge me about this. I'm with visual studio 2022, NET8.
Sorry if my english is bad, I'm learning. I hope that you can understand. Thank you!
I have this button set up to increase an int value when clicked and decrease when you press shift and the button. It then displays the amount in a label. I'm trying to figure out how to prevent it from going below 0. As I currently have it, it drops to a negative number then display the message box. Any thoughts how I can make this work?
If OGeneralT >= 0 Then
If My.Computer.Keyboard.ShiftKeyDown Then
OGeneralT -= General
Else
OGeneralT += General
End If
lblOGeneral.Text = OGeneralT
Else
MessageBox.Show("Number can't be less than zero")
OGeneralT = 0
End If
Hello VBers!
I was contacted by a recruiter from Capgemini for a mid-role I will paste some of the insights as the text is long.
I was just offered 32 euros per hour (B2B). I live in Romania and I have done a Bachelors here, and a Master's in Switzerland, but I have only a year of experience. The job is for a senior role, so I guess that I will be "sold" like that. Now I would like to counter it, and ask for more. I am thinking of 55 euros/hour (as the technology is old and many avoid it), is it too much? Now I have a very stable job as a .NET developer, but I don't earn that well, I get 1250 euros/month.
Also, if I am fired I have where to live and I have an small extra income flow, so I can still survive.
Thank you all guys, for your time to read this long text and even reply! Appreciate it.
___________________________________________________________________________________________________________
Join our dynamic team to work on a cutting-edge banking project for one of Europe’s largest financial institutions.
MAIN TASKS AND RESPONSIBILITIES
- Design, develop, and maintain backend services and APIs to support various banking
functionalities.
- Collaborate with cross-functional teams to define, design, and ship new features.
...
- 6+ years of experience in software development
- Experience with Visual Basic 6
This VB script is reading text field values being fed from a table, which are coming from an XML file. The values are constantly changing and the XML file is being re-written and the data table is constantly updating the text fields.
I keep getting an error in the application running the script. "Script 'ElectionFS_404' Error Line 7: Object reference not set to an instance of an object". The line this error is occurring is
If Input.Find("results_40").Text("Winner2Mark.Text") = "W" then
Sometimes the loop will run fine for 2 hours, other times it will error out in 3 minutes. I am about to lose my mind trying to figure out what to do with it. I assume the issue is when the XML file or data table is being updated, the text fields are temporarily blank or unavailable. If I immediately restart the script, it will run fine again for some time, then error out again on the same line. I have a couple of similar scripts that all error out on that first If line.
It doesn't seem to care if the field is empty as it errors out even when the "W" is present.
Is there a way to handle this in a way that causes it to ignore the error or start over again?
I'd appreciate any type of feedback or hints as to what I can add or subtract to stop this error. Thank you all for checking out my post. Here is the script -
Dim W, fswinmrk2, fswinmrk1, results_40, ElectionFS_40 As String
Do While True
If Input.Find("results_40").Text("Winner2Mark.Text") = "W" then
API.Function("SetMultiViewOverlay",Input:="ElectionFS_40",Value:="9,fswinmrk2")
Else If Input.Find("results_40").Text("Winner1Mark.Text") = "W" then
API.Function("SetMultiViewOverlay",Input:="ElectionFS_40",Value:="9,fswinmrk1")
Else
API.Function("SetMultiViewOverlay",Input:="ElectionFS_40",Value:="9,none")
End If
Loop
Hi guys, I had some trouble with PrintDialog1.PrinterSettings.SupportsColor
. When I set my printer with with PrintDialog1.PrinterSettings.PrinterName
, I should get that the printer doesn't support colors, but it says that it does. Why? If a try to use the PrintDialog1.ShowDialog()
, it knows that the printer can't use colors but the command says it can. I hate this. I even tried with the PrintDocument, it doesn't work, either. Can you guys please help me?
I'm trying to make a casino with multiple forms, but I don't know how to carry an integer for a money amount from one form to another (example: from the lobby form to the bar table form). Does anyone know how to do this?
I need to quickly study source code of a working legacy project built with VB and asp.net (and a MS SQL Server db), figure out what all the core modules/procedures are and what they do, and turn it a Python FastAPI backend for a future website and mobile/desktop app. I'm a Python/JS dev and have no idea of VB or dotnet.
What would be the best way to approach this? Where should I start? Any resources that can help me with this?
Hi Guys,
Back in the 90s I used code a lot in VB5 and then VB6. It was great. Drag and drop elements on a form. Do some coding. Nothing fancy. I used to make small programs to do simple things. It was great fun building these desktop apps for Windows 9x.
Now I want to get back into this kind of development. Is there any similar solutions these days? Something very very similar and if it's for Mac and somehow can make the "app" into a web app as well, that would be great. Otherwise just desktops for Windows is also fine.
Looking forward to hearing from you all.
Hi all, in my application, I am using Ghostscript to convert RGB to CMYK in a PDF. The conversion works, but I can't control the CMYK values from the RGB input. For example, the expected black CMYK value is 0/0/0/100, but the actual values are different. Does anyone have an idea on how to control this from HTML, or know of any plugin that can control the CMYK values? Alternatively, is there a way to control Ghostscript directly
Nothing happens. Scale is in twips. picMain is the picture control. It should draw an horizontal line in the middle.
Private Sub Form_Load()
x1 = PixelCoordX(picMain.Width, 50, -50, 100)
y1 = PixelCoordY(picMain.Height, 50, 0, 100)
x2 = PixelCoordX(picMain.Width, 50, 50, 100)
y2 = PixelCoordY(picMain.Height, 50, 0, 100)
DrawLine picMain, x1, y1, x2, y2
End Sub
Function PixelCoordX(PictWidth, OffsetX, xCoord, FOVx)
PixelCoordX = PictWidth * ((OffsetX + xCoord) / FOVx)
End Function
Function PixelCoordY(PictHeight, OffsetY, yCoord, FOVy)
PixelCoordY = PictHeight * ((OffsetY + yCoord) / FOVy)
End Function
Function xCoord(PixelCoordX, PictWidth, FOVx, OffsetX)
xCoord = PixelCoordX / PictWidth * FOVx - OffsetX
End Function
Function yCoord(PixelCoordY, PictHeight, FOVy, OffsetY)
yCoord = PixelCoordY / PictHeight * FOVy - OffsetY
End Function
Sub DrawLine(object, x1, y1, x2, y2)
Debug.Print x1, y1, x2, y2
object.Line (x1, y1)-(x2, y2), RGB(0, 0, 0)
End Sub
I have been wondering how do I code two simple rotating pyramids in VB5 while playing some audio. I want to learn to code games. I am using enterprise edition. Help and books online show nothing about directx usage. Dxdiag shows DirectX 9.0c
I live in Casa Grande, AZ. Looking for someone who can help me get VB 6 installed on my laptop.
A client has a VB6 project that they want to make some changes to. After I installed Visual Studios on my laptop, I realized that it would not work on this project. I think I need to install VB6. I went to source forge but not sure what to install. Need some help with what to install and uninstall on my laptop.