r/visualbasic • • Dec 09 '18

VB.NET Help Ideas for an app??

5 Upvotes

Hello I'm new to programming and have been learning visual basic with visual studio for a while now. I want to make an application for practice but not sure what to make. Would anyone have an idea of a useful app I could make? Any ideas or help would be greatly appreciated!! Working in Visual Studio 2017.


r/visualbasic • • Nov 27 '18

Decomposing and reassembling Integers (1000 to 1025) Visual Basic

5 Upvotes

This is my code for a program that takes integers (1000 to 1025) decomposes them, and reassembling them, I imagined 6 listboxs, One for the list of 1000 to 1025, four for the individual digits, and the final one for the reasembled integers. The code works using a textbox and a label to seperate the digits individualy, but how can I transfer it so it works with all the listboxs. As you will see, some of the sections of my code is already planed out for the listbox code, but i cant seem to get it all working. Any well or tips would be great. BTW, my code was in french, and i translated into english to if theres any gramatical mistake, my bad.

Kinda like this: [ ] = Listbox

[1234] [1] [2] [3] [4] [1234]

[1311] [1] [3] [1] [1] [1311]

Public Class frmSepRea

'****************************************************************

Dim NombreInscrit As Integer

Dim Units As Integer

Dim Tens As Integer

Dim Hundreds As Integer

Dim Thousand As Integer

'*****************************************************************

Private Sub btnSepRea_Click(sender As Object, e As EventArgs) Handles btnSepRea.Click

'*************************************************************

'Makes sur that everytime the button is pressed it dosent re-insert the list of
'numbers (1000 to 1025)

While lstInitial.Items.Count > 0

lstInitial.Items.RemoveAt(lstInitial.Items.Count - 1)

End While

'************************************************************

'Ajoute des valeurs a la ListBox Initial.

For i As Integer = 1000 + 1 To 1025

lstInitial.Items.Add(i)

Next

****************************************************

'Decomposition of numbers in the thousands (Working indivudually in a textbox,
'need it in a listbox)

'*************************************************************

NumberInserted = Val(txtNumber.Text)

NumberInserted = Math.Abs(Val(txtNumber.Text))

If (NumberInserted < 10) Then

Me.lblDigit.Text = "The first digit is : " & NumberInserted

ElseIf (NumberInserted < 100) Then

Call SeperateTwoDigits(NumberInserted , Tens, Units)

Me.lblDigit.Text = "The first digit is : " & Dizaines & vbCrLf &

"The first digit is :" & Units

ElseIf (NumberInserted < 1000) Then

Call SeperateThreeDigits(NumberInserted , Hundreds, Tens, Units)

Me.lblDigit.Text = "The first digit is : " & Hundred & vbCrLf &

"The Second number is : " & Tens & vbCrLf &

"The third number is : " & Units

ElseIf (NumberInserted > 1000) And (NumberInserted < 9999) Then

Call SeperateFourDigit(NumberInserted , Thousands, Hundreds, Tens, Units)

Me.lblDigit.Text = "The first number is :" & Thousands & vbCrLf &

"The second number is : " & Hundreds & vbCrLf &

"The third number is : " & Tens & vbCrLf &

"The fourth number is : " & Units

Else

'Limites all other numbers

MessageBox.Show("Nombre non valide")

End If

End Sub

'************************************************************

'Seperate two digits Ex, 10 = 1, 0

'*************************************************************

Sub SeperateTwoDigit(ByVal number As Integer, ByRef Digit1 As Integer, ByRef Digit2 As Integer)

Digit1 = number \ 10

Digit2 = number Mod 10

End Sub

'************************************************************

'Seperate three digits Ex, 123 = 1, 2, 3

'*************************************************************

Sub SeperateThreeDigit(ByVal number As Integer, ByRef Digit1 As Integer, ByRef Digit2 As Integer, ByRef Digit3 As Integer)

Digit1 = number \ 100

number = number Mod 100

Call SeperateTwoDigit(number, Digit2, Digit3)

End Sub

'************************************************************

'Seperate Four digits Ex, 1234 = 1, 2, 3, 4

'*************************************************************

Sub SeperteFourDigit(ByVal number As Integer, ByRef Digit1 As Integer, ByRef Digit2 As Integer, ByRef Digit3 As Integer, ByRef Digit4 As Integer)

Digit1 = number \ 1000

number = number Mod 1000

Digit2 = number \ 100

number = number Mod 100

Digit3 = number \ 10

number = number Mod 10

Digit4 = number

End Sub

Sub ForLoop(ByVal Chiffre1, ByVal Chiffre2, ByVal Chiffre3, ByVal Chiffre4)

'Gonna need a For Loop that is able to use these equasion for each individual
'part

'*****All bellow is theoretical and dont work yet*****

For Each Item In lstInitial.Items

'Do stuff

'Possibiliy ---->

'lstDigit1.Text = Chiffre1

'lstDigit2.Text = Chiffre2

'lstDigit3.Text = Chiffre3

'lstDigit4.Text = Chiffre4

Next

'Or

For i = 0 To lstInitial.Items.Count - 1

'Do stuff

'Need a sepration after for four columbs

'MsgBox(lstInitial.Items(i).ToString) (*example*)

Next

End Sub

Sub Reassembler()

'Reassembling the integers

For Each Item In lstInitial.Items

'Do stuff

lstFinal.Text = Val(lst1digit.Text) & Val(lstDigit2.Text) & Val(lstDigit3.Text) & Val(lstDigit4.Text)

Next

'Or (*Other way*)

For i = 0 To lstInitial.Items.Count - 1

'Do stuff

Next

End Sub

End Class


r/visualbasic • • Nov 02 '18

Using If Else to Calcuate Wages .

5 Upvotes

Hey guys so am making a wage Calc and i am using If Else to perform the calculations if Hours are above 0 make the calc or show a error message if they are 0. Although it doesnt the show error message when hours are 0

Public Class frmGross
Private Sub btnCalcuate_Click(sender As Object, e As EventArgs) Handles btnCalcuate.Click
    Dim decHours As Decimal
    Dim decHourlyWage As Decimal
    Dim decTotalPay As Decimal

    decHours = txtHours.Text
    decHourlyWage = txtHourlyWage.Text
    decTotalPay = decHours * decHourlyWage

    LblTotalPay.Text = decTotalPay

    If decHours >= 0 Then
        decHours = txtHours.Text
        decHourlyWage = txtHourlyWage.Text
        decTotalPay = decHours * decHourlyWage
        LblTotalPay.Text = decTotalPay.ToString("C2")
    Else
        LblTotalPay.Text = "Error"
    End If
End Sub

Private Sub BtnExit_Click(sender As Object, e As EventArgs) Handles BtnExit.Click
    Me.Close()
End Sub

End Class


r/visualbasic • • Oct 25 '18

How to make a "Switch" Button

5 Upvotes

This is my code. Disregard the last sub, it does not work.

'**********************************************************************

'Programmeur: Lucas Després *

'Date: Octobre 2018 *

'But: De convertir les unité de mesure de la température *

'a Celcius et Fahrenheit et vice versa *

'**********************************************************************

Public Class frmConversion

Private Sub frmConversion_Load(sender As Object, e As EventArgs) Handles MyBase.Load

AcceptButton = btnConvertir

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnConvertir.Click

'Crée un Integer pour Fahrenhei et Celcius

Dim intF As Double

Dim intC As Double

intC = Val(txtbxEntree1.Text)

intF = Val(txtbxEntree2.Text)

intF = (intC * 9.0 / 5.0) + 32

intC = (intF * 5.0 / 9.0) - 32

Me.txtbxEntree2.Text = intF

End Sub

Private Sub btnSwitch_Click(sender As Object, e As EventArgs) Handles btnSwitch.Click

Me.lblCelsius.Text = "Fahreneheit"

Me.lblFahrenheit.Text = "Celsius"

Me.lblC.Text = "°F"

Me.lblF.Text = "°C"

End Sub

End Class


r/visualbasic • • Sep 12 '18

Access DAO to SQL database.

5 Upvotes

Hello guys,

I've asked this question before, without any success. Now I got a little more experienced, so I'm able to explain myself better.

My company has a huge VB, wich contains of 15000 lines. Now this is connected to a access db, but because it needs to connect to a Maximo environment, it need to change to a sql database.

What are the easy ways or hard ways for me to change this. Or is there even an option to change this?


r/visualbasic • • Jul 09 '18

Making text-boxes appear and disappear while checkboxes are selected?

5 Upvotes

Interface

Hey, everyone. I was wondering if you guys could help me out or if you just have a solution. This is an interface for a school assignment. When the box/lawn/pavilion checkboxes are checked, a textbox becomes visible underneath. When the same checkbox is unchecked, the textbox's Visible property evaluate to false and disappears. The Visible property is set to false when the application is first run. You are allowed to have any number of the checkboxes checked at the same time as long as their accompanying textbox disappears when they are unchecked.

Does anyone have any ideas? I've been able to get everything else done but for whatever reason I can't figure this out. I've used both if...then statements and case statements but just can't crack it. If you need any other information feel free to message me. Thank you so much!


r/visualbasic • • Jun 07 '18

Remembered an old trick, thought I'd share

Post image
5 Upvotes

r/visualbasic • • May 08 '18

VB.NET Help [VB.NET]Help with pushing changes back to a database

5 Upvotes

Alright so I'm working on a final project. I use

Me.LEVEL_INSTANCETableAdapter.Fill(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.L_COLUMNSTableAdapter.Fill(Me.LevelsDataSet.L_COLUMNS)
Me.HIGH_SCORESTableAdapter.Fill(Me.LevelsDataSet.HIGH_SCORES)

On form load to grab info from the database. I make changes with queries and stored procedures.

LEVEL_INSTANCETableAdapter.UnlockLevel(intLevelNum)
HIGH_SCORESTableAdapter.UpdateHighScore(SCORE:=intScore, LvlID:=intLevelNum, PlayerName:=strName)

These execute just fine, I can see the changes they make elsewhere in my program. then the issue comes when I try to save back to the database. I use.

Me.Validate()
Me.LEVEL_INSTANCEBindingSource.EndEdit()
Me.HIGH_SCORESBindingSource.EndEdit()

Then use

Me.TableAdapterManager.UpdateAll(Me.LevelsDataSet)
Me.LEVEL_INSTANCETableAdapter.Update(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.HIGH_SCORESTableAdapter.Update(Me.LevelsDataSet.HIGH_SCORES)

The data never goes back to the database (and if I understand the update method correctly, it returns a number that represents the number of rows changed, which for me, are always zero)

I have the dataset, tableadaptermanager, tableadapters, and binding navigators. my database and dataset's "copy to output dir" is set to "copy if newer"

I have also tried another method that starts with this

Dim NewHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Added), LevelsDataSet.HIGH_SCORESDataTable)
Dim ModifiedHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Modified), LevelsDataSet.HIGH_SCORESDataTable)

But it seems like getchanges in that line is showing no changes...

I've seen methods which directly interact with the database, ones that directly update, or calling on the database to run queries directly. I'd like to avoid those if possible. I'm really at my last legs here guys, I'll probably pass the class/assignment even if I don't get this working, but I'd like to understand it for the future... Thanks for all your responses in advance.

Edit: formatting


r/visualbasic • • Jul 20 '17

VB.NET Help Moving the Form while a Process is still running?

5 Upvotes

Hi there. So I am trying to make a Youtube-DL GUI, and am a bit stumped.

Here is the code I used.

Here, meanwhile, is the form design.

Here are my checklists, and if you guy could help me out, I owe you a big virtual hug/high-5!

  • I cannot move the form while the youtube-dl process is still running.

  • In CMD/batch, the youtube-dl's percentage is updated on a single line, while I cannot do so & have to make a new line for each percentage.

  • In connection with list 1, I cannot click anything while the process is still running.

  • BONUS: displaying percentage of each video's progress in progress bar. If list 2 is achieved, this one should be alright.

Thanks in advance!


r/visualbasic • • Jun 17 '17

Memory Game ( Concentration )

5 Upvotes

Hello, I'm in need of help with trying to make a Memory game, 4x4 with score and guesses. If anyone knows a guide on how to make one or can help me please let me know. thanks! :)


r/visualbasic • • Feb 03 '17

Thank you guys for reporting the spam.

5 Upvotes

I don't know how else to fight it other than limiting submissions to older accounts. I feel like that might prevent some legitimate posts from coming through.

Anybody else have any ideas?


r/visualbasic • • Oct 20 '16

Reasoning behind backwards loop

5 Upvotes

I am running some code to look through our bank and match it to our accounting, and i am using a for i=m to 1...next loop - step -1. When i change it to go forward ( step+1) it messes everything up. I've seen this before, but why?


r/visualbasic • • Oct 20 '16

Is there a way to convert my website that's in aspx.vb into a aspx.cs?

5 Upvotes

Using Visual Basic community


r/visualbasic • • Jun 03 '16

Understanding VB6 Database Files

5 Upvotes

This may be a tall order I'm requesting but here goes. In VB6 I can create a Random Access file in it's basic format example

&nbsp

Type Trip

&nbsp

Car as string * 50

&nbsp

Hotel as string * 90

&nbsp

end Type

&nbsp

What I don't understand is how to delete a Record

&nbsp

. I've tried understanding some programmers in the past but they seem to always say terms that aren't clear to. I've tried reading up on up but they to can't seem to convey an understanding like bring up an ISAM table and I'm supposed to understand what it's for and how to use it.

&nbsp

&nbsp

I've used VB6's feature for creating a binary file however that still

&nbsp

leaves me in the dark on ok how does it do what it's doing?


r/visualbasic • • May 17 '16

How to upload VB project to Azure

5 Upvotes

I want to be able to run my project on the college computer and they do not allow applications to be installed.

The program is a windows form application so I assume I can't just publish it to Azure.

Is there any way to get this to work without installing in on the computer?

If not I guess I will have to borrow someone's laptop.

Thanks


r/visualbasic • • May 15 '16

Visual Basic Helper Survey for School

5 Upvotes

https://docs.google.com/forms/d/1RylAU8Uk64DgaB-ENQQi_0VrTe5TB070KIXS1zGhQ5k/viewform

Can you guys do this survey, its somewhat related to Visual Basic and very simple.


r/visualbasic • • May 05 '16

[VBS] Adding only numeric variables

5 Upvotes

I have something like this:

var1 = 34.5
var2 = 61.5
var3 = 5.9
.... 'etc
 newVar = var1 + var2 + var3 + ....

But var1 through varX could have a non-numeric value, and I want to sum them if they are valid numbers. My first thought is:

If isNumeric(var1) And isNumeric(var2) Then
    newVar = var1 + var2
End If

If isNumeric(var3) and isNumeric(var4) Then
    newVar = newVar + var4 + var4
End If

But this presents two problems:

  1. It's ugly and wildly inefficient

  2. If var1 is numeric and var2 is NOT, then var1 gets left out of the sum

Is there a way to do this in a compact loop? Can someone point me in the right direction?


EDIT! I solved it with this:

arrVals(0) = var1
arrVals(1) = var2
arrVals(2) = var3
.... 'etc

For i = 0 to UBound(arrVals)
    If IsNumeric(arrVals(i)) Then
        newVar = newVar + arrVals(i)
    End If
Next

r/visualbasic • • Apr 18 '16

Gridview help

5 Upvotes

Hello all,

I am currently coding with Visual Community 2015 and I have a drop down list inside of a gridview. I need to select an item from inside the gridview in order to finish my code, however the code does not recognize the drop down list name.

Any ideas on what I can do to fix this? I'm pretty sure it's because of the gridview that it is not working as I tried a drop down list outside the gridview and the code recognized it.


r/visualbasic • • Mar 14 '16

Add Try/Catch en masse to program with no error traps?

5 Upvotes

So full disclosure, I am not a programmer but thanks to Google and persistence I have actually put together a functioning program to import CSV's to an Access Database (It's NOT pretty under the hood) that I am happy with.

The problem I have is that this program is fairly large at close to 2000 lines and I didn't even understand error trapping when I started.

My question is, is there a way to add a Try/Catch to every subroutine at once, or do I just need to bite the bullet and get to dropping them in manually? Sorry if this is a silly question.

Thanks for taking the time to read my question.


r/visualbasic • • Feb 12 '16

[HELP][Visual Studio Community 2015] Is there a way to make an editable excel-like table on a VB form?

5 Upvotes

I'm trying to make a program that deals with arrays of numbers and allows users to input data in a table which can then be read and altered by the program. I'd like this table to be of variable length definable by the program, but with a fixed number of columns, and have a scrollbar which only scrolls the table. This is a mockup of what I'm looking to do. I don't need it to work like an excel, that is, it doesn't need to be able to solve formulas or be formattable or any of that, I just want the data entry to be just like excel. I have been searching everywhere trying to find if this is possible, or if there is another programming language that could better handle this. Thanks!


r/visualbasic • • Jan 23 '16

Visual Basic word guess program

5 Upvotes

I don't know how to keep track of the letters guessed in an array with meaningful indexes. Can somebody help me?

Private Sub btnPlayGame_Click(sender As Object, e As EventArgs) Handles btnPlayGame.Click
    Const SECRET_WORD As String = "VELOCITY"
    Const FLAG As Char = "!"
    Const GUESS_PROMPT As String = "Enter a letter or " & FLAG & " to guess word:"
    Dim numGuesses As Integer = 0
    Dim letterGuess As Char
    Dim wordGuess As String
    Dim tempWord As String
    Dim endGame As Boolean

    Dim wordGuessedSoFar As String = ""
    Dim length As Integer = SECRET_WORD.Length
    wordGuessedSoFar = wordGuessedSoFar.PadLeft(length, "-")
    Me.lblSecretWord.Text = wordGuessedSoFar

    Dim tempLetterGuess = InputBox(GUESS_PROMPT, Me.Text)
    If tempLetterGuess = Nothing Then
        endGame = True
    Else
        letterGuess = tempLetterGuess
    End If

    Do While letterGuess <> FLAG And wordGuessedSoFar <> SECRET_WORD _
    And Not endGame
        numGuesses += 1
        For letterPos As Integer = 0 To SECRET_WORD.Length - 1
            If SECRET_WORD(letterPos) = Char.ToUpper(letterGuess) Then
                tempWord = wordGuessedSoFar.Remove(letterPos, 1)
                wordGuessedSoFar = tempWord.Insert(letterPos, Char.ToUpper(letterGuess))
                Me.lblSecretWord.Text = wordGuessedSoFar
            End If
        Next letterPos

        If wordGuessedSoFar <> SECRET_WORD Then
            tempLetterGuess = InputBox(GUESS_PROMPT, Me.Text)
            If tempLetterGuess = Nothing Then
                endGame = True
            Else
                letterGuess = tempLetterGuess
            End If
        End If
    Loop

    If wordGuessedSoFar = SECRET_WORD Then
        MessageBox.Show("You guessed it in " & numGuesses & " guesses!")
    ElseIf letterGuess = FLAG Then
        wordGuess = InputBox("Enter a word: ", Me.Text)
        If wordGuess.ToUpper = SECRET_WORD Then
            MessageBox.Show("You guessed it in " & numGuesses & " guesses!")
            Me.lblSecretWord.Text = SECRET_WORD
        Else
            MessageBox.Show("Sorry you lose.")
        End If
    Else
        MessageBox.Show("Game over.")
    End If
End Sub

r/visualbasic • • Nov 12 '15

VB6 Help Does Windows have any native VBS editor?

5 Upvotes

I am at work, and want to write scripts in VB, but I dont want to use notepad to do it, and I cant download anything like notepad++.


r/visualbasic • • Sep 06 '15

Board Game Visual Basics 2010

5 Upvotes

I'm writing a code for a board game.

To play the game, a player generates two random numbers and colours in an area on the grid indicated by the numbers. For example if the generated number is a 2 and a 3 the player clicks in the 2x3 square which results in the colour of the square being changed.

A player should only be able to click and change the colour of the square represented by the random numbers only.

At the start of the game, the initial score should have a value of 0. With each square coloured the score increases by the product of two numbers. You can display the score anywhere within the user interface.

I'm unable to change the colour of the square represented by the random numbers only. and I'm also having difficulty at score keeping.

Here is my Code:

Public Class Form1 Private Grid(3, 3) As Button Private btnSize As Integer = 25 Private btnPosn As New Point(10, 10)

Private randomRow As Integer
Private randomCol As Integer


Shared random As New Random()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    'Random Number Generator
    Dim i As Integer
    For i = 0 To 5
        TextBox1.Text = (Convert.ToString(random.Next(1, 5)))
        TextBox2.Text = (Convert.ToString(random.Next(1, 5)))

    Next

End Sub

Dim elapTimer As New Threading.Timer(AddressOf tick, Nothing, 1000, 1000)
Dim stpw As Stopwatch = Stopwatch.StartNew

Private Sub tick(ByVal state As Object)
    'Timer
    If stpw.IsRunning Then

        Me.Invoke(Sub()
                      Label1.Text = stpw.Elapsed.ToString("hh\:mm\:ss\.")
                  End Sub)
    End If

End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    CreateGrid()
End Sub
Private Sub CreateGrid()
    'Create a 4x4 grid of buttons with a common event handler. References
    'to the buttons are stored in "Grid" for easy access. The row and
    'column numbers are stored in the button tags to differentiate the
    'individual buttons in the click handler.
    For row As Integer = 0 To 3
        For col As Integer = 0 To 3
            Dim xpos As Integer = btnPosn.X + btnSize * col
            Dim ypos As Integer = btnPosn.Y + btnSize * row
            Dim btn As New Button()
            btn.Tag = {row, col}
            btn.Location = New Point(xpos, ypos)
            btn.Size = New Size(btnSize, btnSize)
            AddHandler btn.Click, AddressOf Grid_Click
            Me.Controls.Add(btn)
            Grid(row, col) = btn
        Next
    Next
End Sub
Dim ClickCount As Integer = 0

Private Sub Grid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim btn As Button = sender
    Dim row As Integer = btn.Tag(0)
    Dim col As Integer = btn.Tag(1)
    Me.Text = "you clicked cell (" & row & "," & col & ")"



    'Color Change
        If Not ClickCount = 4 Then
            ClickCount += 1
        Else
            ClickCount = 1
        End If

        Select Case ClickCount
            Case Is = 1
                Grid(row, col).BackColor = Color.Green
            Case Is = 2
                Grid(row, col).BackColor = Color.Yellow
            Case Is = 3
                Grid(row, col).BackColor = Color.Red

        End Select





End Sub

r/visualbasic • • Jun 04 '15

Question How do you guys like work with properties on custom controls.

5 Upvotes

I am working on a form theming system. I have added rounded corners to the form where you can control the radius of the corner.

I want to add the capacity to specify which corners are rounded and which are not. This can be accomplished a bunch of different ways.

  1. Set separate properties for each of the corners radius's. You would enter 0 for a square corner or the radius for a round one.

  2. A single property that behaves like above but is just a space delimited list eg: 10 10 0 0

  3. Boolean for rounded or not for each corner, setting the radius in a single location. This one would force consistency.


r/visualbasic • • Jun 04 '15

Solved Help me figure out a better way to make rounded corners for my forms.

5 Upvotes

I am building a open source them system for winforms, becuase all the ones that are good cost a lot of money.

I am making rounded corners on my form by using System.Drawing.Drawing2D and transparency key of Fuchsia. I used Fuchsia because it's ugly and if you make your form that color it is your own fault it will be transparent. :)

I am drawing the corners via bruteforce with the following code (This is only the upper right so you can imagine what it looks like for all the corners.)

G.FillRectangle(Brushes.Fuchsia, 0, 0, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 1, 0, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 2, 0, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 3, 0, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 0, 1, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 0, 2, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 0, 3, 1, 1)
G.FillRectangle(Brushes.Fuchsia, 1, 1, 1, 1)

G.FillRectangle(New SolidBrush(HeaderColor), 1, 3, 1, 1)
G.FillRectangle(New SolidBrush(HeaderColor), 1, 2, 1, 1)
G.FillRectangle(New SolidBrush(HeaderColor), 2, 1, 1, 1)
G.FillRectangle(New SolidBrush(HeaderColor), 3, 1, 1, 1)

does anybody know how I can draw the corners programmatically? I wish to do this so that I can make the corners size modifiable at design time.

I am investigating the GraphicsPath.AddPie and trying to figure out how to invert the image so that the corner edge is drawn but it is not working out.

Once this working and I am happy I will GitHub the whole thing with my tutorial, and post to here.