Circle Progress Bar Control for VB.NET

Add a new User Control and add these codes in it :

   Dim _Myrr As Integer  
   Public Property rr As Integer  
     Set(value As Integer)  
       _Myrr = value  
     End Set  
     Get  
       Return _Myrr  
     End Get  
   End Property  
   Private Sub DrawProgress(g As Graphics, rect As Rectangle, percentage As Single)  
     'work out the angles for each arc  
     Dim progressAngle = CSng(360 / 100 * percentage)  
     Dim remainderAngle = 360 - progressAngle  
     'create pens to use for the arcs  
     Using progressPen As New Pen(Color.LightSeaGreen, 2), remainderPen As New Pen(Color.LightGray, 2)  
       'set the smoothing to high quality for better output  
       g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias  
       'draw the blue and white arcs  
       g.DrawArc(progressPen, rect, -90, progressAngle)  
       g.DrawArc(remainderPen, rect, progressAngle - 90, remainderAngle)  
     End Using  
     'draw the text in the centre by working out how big it is and adjusting the co-ordinates accordingly  
     Using fnt As New Font(Me.Font.FontFamily, 14)  
       Dim text As String = percentage.ToString + "%"  
       Dim textSize = g.MeasureString(text, fnt)  
       Dim textPoint As New Point(CInt(rect.Left + (rect.Width / 2) - (textSize.Width / 2)), CInt(rect.Top + (rect.Height / 2) - (textSize.Height / 2)))  
       'now we have all the values draw the text  
       g.DrawString(text, fnt, Brushes.Black, textPoint)  
     End Using  
   End Sub  
   Private Sub UserControl1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint  
     DrawProgress(e.Graphics, New Rectangle(5, 5, 60, 60), _Myrr)  
   End Sub  

Don't forget to add these two namespaces :

 Imports System.Drawing  
 Imports System.Windows.Forms  

 Now Build your project and then check your ToolBox you'll see a new Tool

That's our Circle Progress Bar!
Now add our Progress Bar, a Timer and a Button.

Timer1_Tick Code :

     If UPT >= 100 Then  
       UPT = 0  
     Else  
       UPT = UPT + 1  
     End If  
     UserControl11.rr = UPT  
     UserControl11.Invalidate()  
     UserControl11.Update()  
     UserControl11.Refresh()  

Button1_Click Code :

   Timer1.Enabled = True  

Under Public Class add this Integer

   Public UPT As Integer  

That's it, it should work fine now...


This is just an example of a Circle Progress Bar I found online, do comment your suggestions.

How to Get FireFox Theme in VB.NET


Just add a New Class and Copy & Past all these codes in it

 ' Firefox Theme.  
 ' Made by AeroRev9.  
 ' 25/07/2015.  
 ' Updated : 29/07/2015 [2].  
 ' Credits : Mavaamarten, Xertz.  
 Imports System.ComponentModel  
 Imports System.Drawing.Drawing2D  
 Imports System.Drawing.Text  
 Module Theme  
   Public ReadOnly Property GlobalFont(B As FontStyle, S As Integer) As Font  
     Get  
       Return New Font("Segoe UI", S, B)  
     End Get  
   End Property  
   Public Function GetCheckMark() As String  
     Return "iVBORw0KGgoAAAANSUhEUgAAABMAAAAQCAYAAAD0xERiAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEySURBVDhPY/hPRUBdw/79+/efVHz77bf/X37+wRAn2bDff/7+91l+83/YmtsYBpJs2ITjz/8rTbrwP2Dlrf9XXn5FkSPJsD13P/y3nHsVbNjyy28w5Ik27NWXX//TNt8DG1S19zFWNRiGvfzy8//ccy9RxEB4wvFnYIMMZl7+//brLwx5EEYx7MP33/9dF18Ha1py8RVcHBR7mlMvgsVXX8X0Hgwz/P379z8yLtz5AKxJdcpFcBj9+v3nf/CqW2Cx5E13UdSiYwzDvv36/d9/BUSzzvRL/0t2PQSzQd57+vEHilp0jGEYCJ9+8hnuGhiee+4Vhjp0jNUwEN566/1/m/mQZJC/48H/zz9+YVWHjHEaBsKgwAZ59eH771jl0TFew0D48osvWMWxYYKGEY///gcAqiuA6kEmfEMAAAAASUVORK5CYII="  
   End Function  
 End Module  
 Module Helpers  
   Public Enum MouseState As Byte  
     None = 0  
     Over = 1  
     Down = 2  
   End Enum  
   Public Function FullRectangle(S As Size, Subtract As Boolean) As Rectangle  
     If Subtract Then  
       Return New Rectangle(0, 0, S.Width - 1, S.Height - 1)  
     Else  
       Return New Rectangle(0, 0, S.Width, S.Height)  
     End If  
   End Function  
   Public Function GreyColor(G As UInteger) As Color  
     Return Color.FromArgb(G, G, G)  
   End Function  
   Public Sub CenterString(G As Graphics, T As String, F As Font, C As Color, R As Rectangle)  
     Dim TS As SizeF = G.MeasureString(T, F)  
     Using B As New SolidBrush(C)  
       G.DrawString(T, F, B, New Point(R.Width / 2 - (TS.Width / 2), R.Height / 2 - (TS.Height / 2)))  
     End Using  
   End Sub  
   Public Sub FillRoundRect(G As Graphics, R As Rectangle, Curve As Integer, C As Color)  
     Using B As New SolidBrush(C)  
       G.FillPie(B, R.X, R.Y, Curve, Curve, 180, 90)  
       G.FillPie(B, R.X + R.Width - Curve, R.Y, Curve, Curve, 270, 90)  
       G.FillPie(B, R.X, R.Y + R.Height - Curve, Curve, Curve, 90, 90)  
       G.FillPie(B, R.X + R.Width - Curve, R.Y + R.Height - Curve, Curve, Curve, 0, 90)  
       G.FillRectangle(B, CInt(R.X + Curve / 2), R.Y, R.Width - Curve, CInt(Curve / 2))  
       G.FillRectangle(B, R.X, CInt(R.Y + Curve / 2), R.Width, R.Height - Curve)  
       G.FillRectangle(B, CInt(R.X + Curve / 2), CInt(R.Y + R.Height - Curve / 2), R.Width - Curve, CInt(Curve / 2))  
     End Using  
   End Sub  
   Public Sub DrawRoundRect(G As Graphics, R As Rectangle, Curve As Integer, C As Color)  
     Using P As New Pen(C)  
       G.DrawArc(P, R.X, R.Y, Curve, Curve, 180, 90)  
       G.DrawLine(P, CInt(R.X + Curve / 2), R.Y, CInt(R.X + R.Width - Curve / 2), R.Y)  
       G.DrawArc(P, R.X + R.Width - Curve, R.Y, Curve, Curve, 270, 90)  
       G.DrawLine(P, R.X, CInt(R.Y + Curve / 2), R.X, CInt(R.Y + R.Height - Curve / 2))  
       G.DrawLine(P, CInt(R.X + R.Width), CInt(R.Y + Curve / 2), CInt(R.X + R.Width), CInt(R.Y + R.Height - Curve / 2))  
       G.DrawLine(P, CInt(R.X + Curve / 2), CInt(R.Y + R.Height), CInt(R.X + R.Width - Curve / 2), CInt(R.Y + R.Height))  
       G.DrawArc(P, R.X, R.Y + R.Height - Curve, Curve, Curve, 90, 90)  
       G.DrawArc(P, R.X + R.Width - Curve, R.Y + R.Height - Curve, Curve, Curve, 0, 90)  
     End Using  
   End Sub  
   Public Sub CenterStringTab(G As Graphics, text As String, font As Font, brush As Brush, rect As Rectangle, Optional shadow As Boolean = False, Optional yOffset As Integer = 0)  
     Dim textSize As SizeF = G.MeasureString(text, font)  
     Dim textX As Integer = rect.X + (rect.Width / 2) - (textSize.Width / 2)  
     Dim textY As Integer = rect.Y + (rect.Height / 2) - (textSize.Height / 2) + yOffset  
     If shadow Then G.DrawString(text, font, Brushes.Black, textX + 1, textY + 1)  
     G.DrawString(text, font, brush, textX, textY + 1)  
   End Sub  
 End Module  
 <DefaultEvent("CheckedChanged")>  
 Class FirefoxRadioButton  
   Inherits Control  
 #Region " Public "  
   Public Event CheckedChanged(sender As Object, e As EventArgs)  
 #End Region  
 #Region " Private "  
   Private State As MouseState  
   Private ETC As Color = Nothing  
   Private G As Graphics  
   Private _EnabledCalc As Boolean  
   Private _Checked As Boolean  
   Private _Bold As Boolean  
 #End Region  
 #Region " Properties "  
   Public Property Checked As Boolean  
     Get  
       Return _Checked  
     End Get  
     Set(value As Boolean)  
       _Checked = value  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property Enabled As Boolean  
     Get  
       Return EnabledCalc  
     End Get  
     Set(value As Boolean)  
       _EnabledCalc = value  
       Invalidate()  
     End Set  
   End Property  
   <DisplayName("Enabled")>  
   Public Property EnabledCalc As Boolean  
     Get  
       Return _EnabledCalc  
     End Get  
     Set(value As Boolean)  
       Enabled = value  
       Invalidate()  
     End Set  
   End Property  
   Public Property Bold As Boolean  
     Get  
       Return _Bold  
     End Get  
     Set(value As Boolean)  
       _Bold = value  
       Invalidate()  
     End Set  
   End Property  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     ForeColor = Color.FromArgb(66, 78, 90)  
     Font = GlobalFont(FontStyle.Regular, 10)  
     Size = New Size(160, 27)  
     Enabled = True  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     If Enabled Then  
       ETC = Color.FromArgb(66, 78, 90)  
       Select Case State  
         Case MouseState.Over, MouseState.Down  
           Using P As New Pen(Color.FromArgb(34, 146, 208))  
             G.DrawEllipse(P, New Rectangle(2, 2, 22, 22))  
           End Using  
         Case Else  
           Using P As New Pen(GreyColor(190))  
             G.DrawEllipse(P, New Rectangle(2, 2, 22, 22))  
           End Using  
       End Select  
       If Checked Then  
         Using B As New SolidBrush(Color.FromArgb(34, 146, 208))  
           G.FillEllipse(B, New Rectangle(7, 7, 12, 12))  
         End Using  
       End If  
     Else  
       ETC = GreyColor(170)  
       Using P As New Pen(GreyColor(210))  
         G.DrawEllipse(P, New Rectangle(2, 2, 22, 22))  
       End Using  
       If Checked Then  
         Using B As New SolidBrush(Color.FromArgb(34, 146, 208))  
           G.FillEllipse(B, New Rectangle(7, 7, 12, 12))  
         End Using  
       End If  
     End If  
     Using B As New SolidBrush(ETC)  
       If Bold Then  
         G.DrawString(Text, GlobalFont(FontStyle.Bold, 10), B, New Point(32, 4))  
       Else  
         G.DrawString(Text, GlobalFont(FontStyle.Regular, 10), B, New Point(32, 4))  
       End If  
     End Using  
   End Sub  
   Protected Overrides Sub OnMouseDown(e As MouseEventArgs)  
     MyBase.OnMouseDown(e)  
     State = MouseState.Down : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseUp(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     If Enabled Then  
       If Not Checked Then  
         For Each C As Control In Parent.Controls  
           If TypeOf C Is FirefoxRadioButton Then  
             DirectCast(C, FirefoxRadioButton).Checked = False  
           End If  
         Next  
       End If  
       Checked = True  
       RaiseEvent CheckedChanged(Me, e)  
     End If  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseEnter(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseLeave(e As EventArgs)  
     MyBase.OnMouseLeave(e)  
     State = MouseState.None : Invalidate()  
   End Sub  
 #End Region  
 End Class  
 <DefaultEvent("CheckedChanged")>  
 Class FirefoxCheckBox  
   Inherits Control  
 #Region " Public "  
   Public Event CheckedChanged(sender As Object, e As EventArgs)  
 #End Region  
 #Region " Private "  
   Private State As MouseState  
   Private ETC As Color = Nothing  
   Private G As Graphics  
   Private _EnabledCalc As Boolean  
   Private _Checked As Boolean  
   Private _Bold As Boolean  
 #End Region  
 #Region " Properties "  
   Public Property Checked As Boolean  
     Get  
       Return _Checked  
     End Get  
     Set(value As Boolean)  
       _Checked = value  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property Enabled As Boolean  
     Get  
       Return EnabledCalc  
     End Get  
     Set(value As Boolean)  
       _EnabledCalc = value  
       Invalidate()  
     End Set  
   End Property  
   <DisplayName("Enabled")>  
   Public Property EnabledCalc As Boolean  
     Get  
       Return _EnabledCalc  
     End Get  
     Set(value As Boolean)  
       Enabled = value  
       Invalidate()  
     End Set  
   End Property  
   Public Property Bold As Boolean  
     Get  
       Return _Bold  
     End Get  
     Set(value As Boolean)  
       _Bold = value  
       Invalidate()  
     End Set  
   End Property  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     ForeColor = Color.FromArgb(66, 78, 90)  
     Font = GlobalFont(FontStyle.Regular, 10)  
     Size = New Size(160, 27)  
     Enabled = True  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     If Enabled Then  
       ETC = Color.FromArgb(66, 78, 90)  
       Select Case State  
         Case MouseState.Over, MouseState.Down  
           DrawRoundRect(G, New Rectangle(3, 3, 20, 20), 3, Color.FromArgb(44, 156, 218))  
         Case Else  
           DrawRoundRect(G, New Rectangle(3, 3, 20, 20), 3, GreyColor(200))  
       End Select  
       If Checked Then  
         Using I As Image = Image.FromStream(New IO.MemoryStream(Convert.FromBase64String(GetCheckMark)))  
           G.DrawImage(I, New Point(4, 5))  
         End Using  
       End If  
     Else  
       ETC = GreyColor(170)  
       DrawRoundRect(G, New Rectangle(3, 3, 20, 20), 3, GreyColor(220))  
       If Checked Then  
         Using I As Image = Image.FromStream(New IO.MemoryStream(Convert.FromBase64String(GetCheckMark)))  
           G.DrawImage(I, New Point(4, 5))  
         End Using  
       End If  
     End If  
     Using B As New SolidBrush(ETC)  
       If Bold Then  
         G.DrawString(Text, GlobalFont(FontStyle.Bold, 10), B, New Point(32, 4))  
       Else  
         G.DrawString(Text, GlobalFont(FontStyle.Regular, 10), B, New Point(32, 4))  
       End If  
     End Using  
   End Sub  
   Protected Overrides Sub OnMouseDown(e As MouseEventArgs)  
     MyBase.OnMouseDown(e)  
     State = MouseState.Down : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseUp(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     If Enabled Then  
       Checked = Not Checked  
       RaiseEvent CheckedChanged(Me, e)  
     End If  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseEnter(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseLeave(e As EventArgs)  
     MyBase.OnMouseLeave(e)  
     State = MouseState.None : Invalidate()  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxH1  
   Inherits Label  
 #Region " Private "  
   Private G As Graphics  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     AutoSize = False  
     Font = New Font("Segoe UI Semibold", 20)  
     ForeColor = Color.FromArgb(76, 88, 100)  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     Using P As New Pen(GreyColor(200))  
       G.DrawLine(P, New Point(0, 50), New Point(Width, 50))  
     End Using  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxH2  
   Inherits Label  
 #Region " Control "  
   Sub New()  
     Font = GlobalFont(FontStyle.Bold, 10)  
     ForeColor = Color.FromArgb(76, 88, 100)  
     BackColor = Color.White  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxButton  
   Inherits Control  
 #Region " Private "  
   Private State As MouseState  
   Private ETC As Color = Nothing  
   Private G As Graphics  
   Private _EnabledCalc As Boolean  
 #End Region  
 #Region " Properties "  
   Public Shadows Property Enabled As Boolean  
     Get  
       Return EnabledCalc  
     End Get  
     Set(value As Boolean)  
       _EnabledCalc = value  
       Invalidate()  
     End Set  
   End Property  
   <DisplayName("Enabled")>  
   Public Property EnabledCalc As Boolean  
     Get  
       Return _EnabledCalc  
     End Get  
     Set(value As Boolean)  
       Enabled = value  
       Invalidate()  
     End Set  
   End Property  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     Enabled = True  
     ForeColor = Color.FromArgb(56, 68, 80)  
     Font = GlobalFont(FontStyle.Regular, 10)  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     If Enabled Then  
       ETC = Color.FromArgb(56, 68, 80)  
       Select Case State  
         Case MouseState.None  
           Using B As New SolidBrush(GreyColor(245))  
             G.FillRectangle(B, New Rectangle(1, 1, Width - 2, Height - 2))  
           End Using  
           DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(193))  
         Case MouseState.Over  
           Using B As New SolidBrush(GreyColor(232))  
             G.FillRectangle(B, New Rectangle(1, 1, Width - 2, Height - 2))  
           End Using  
           DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(193))  
         Case Else  
           Using B As New SolidBrush(GreyColor(212))  
             G.FillRectangle(B, New Rectangle(1, 1, Width - 2, Height - 2))  
           End Using  
           DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(193))  
       End Select  
     Else  
       ETC = GreyColor(170)  
       Using B As New SolidBrush(GreyColor(245))  
         G.FillRectangle(B, New Rectangle(1, 1, Width - 2, Height - 2))  
       End Using  
       DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(223))  
     End If  
     CenterString(G, Text, GlobalFont(FontStyle.Regular, 10), ETC, FullRectangle(Size, False))  
   End Sub  
   Protected Overrides Sub OnMouseUp(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseDown(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     State = MouseState.Down : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseEnter(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseLeave(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.None : Invalidate()  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxRedirect  
   Inherits Control  
 #Region " Private "  
   Private State As MouseState  
   Private G As Graphics  
   Private FC As Color = Nothing  
   Private FF As Font = Nothing  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     Cursor = Cursors.Hand  
     BackColor = Color.White  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     Select Case State  
       Case MouseState.Over  
         FC = Color.FromArgb(23, 140, 229)  
         FF = GlobalFont(FontStyle.Underline, 10)  
       Case MouseState.Down  
         FC = Color.FromArgb(255, 149, 0)  
         FF = GlobalFont(FontStyle.Regular, 10)  
       Case Else  
         FC = Color.FromArgb(0, 149, 221)  
         FF = GlobalFont(FontStyle.Regular, 10)  
     End Select  
     Using B As New SolidBrush(FC)  
       G.DrawString(Text, FF, B, New Point(0, 0))  
     End Using  
   End Sub  
   Protected Overrides Sub OnMouseUp(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseDown(e As MouseEventArgs)  
     MyBase.OnMouseUp(e)  
     State = MouseState.Down : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseEnter(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.Over : Invalidate()  
   End Sub  
   Protected Overrides Sub OnMouseLeave(e As EventArgs)  
     MyBase.OnMouseEnter(e)  
     State = MouseState.None : Invalidate()  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxSubTabControl  
   Inherits TabControl  
 #Region " Private "  
   Private G As Graphics  
   Private TabRect As Rectangle  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     Alignment = TabAlignment.Top  
   End Sub  
   Protected Overrides Sub OnCreateControl()  
     MyBase.OnCreateControl()  
     SetStyle(ControlStyles.UserPaint, True)  
     ItemSize = New Size(100, 40)  
     SizeMode = TabSizeMode.Fixed  
   End Sub  
   Protected Overrides Sub OnControlAdded(e As ControlEventArgs)  
     MyBase.OnControlAdded(e)  
     Try  
       For i As Integer = 0 To TabPages.Count - 1  
         TabPages(i).BackColor = Color.White  
         TabPages(i).ForeColor = Color.FromArgb(66, 79, 90)  
         TabPages(i).Font = GlobalFont(FontStyle.Regular, 10)  
       Next  
     Catch  
     End Try  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     For i As Integer = 0 To TabPages.Count - 1  
       TabRect = GetTabRect(i)  
       If GetTabRect(i).Contains(Me.PointToClient(Cursor.Position)) And Not SelectedIndex = i Then  
         Using B As New SolidBrush(GreyColor(240))  
           G.FillRectangle(B, New Rectangle(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2, GetTabRect(i).Width, GetTabRect(i).Height + 1))  
         End Using  
       ElseIf SelectedIndex = i Then  
         Using B As New SolidBrush(GreyColor(240))  
           G.FillRectangle(B, New Rectangle(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2, GetTabRect(i).Width, GetTabRect(i).Height + 1))  
         End Using  
         Using P As New Pen(Color.FromArgb(255, 149, 0), 4)  
           G.DrawLine(P, New Point(TabRect.X - 2, TabRect.Y + ItemSize.Height - 2), New Point(TabRect.X + TabRect.Width - 2, TabRect.Y + ItemSize.Height - 2))  
         End Using  
       ElseIf Not SelectedIndex = i Then  
         G.FillRectangle(Brushes.White, GetTabRect(i))  
       End If  
       Using B As New SolidBrush(Color.FromArgb(56, 69, 80))  
         CenterStringTab(G, TabPages(i).Text, GlobalFont(FontStyle.Regular, 10), B, GetTabRect(i))  
       End Using  
     Next  
     Using P As New Pen(GreyColor(200))  
       G.DrawLine(P, New Point(0, ItemSize.Height + 2), New Point(Width, ItemSize.Height + 2))  
     End Using  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxMainTabControl  
   Inherits TabControl  
 #Region " Private "  
   Private G As Graphics  
   Private TabRect As Rectangle  
   Private FC As Color = Nothing  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     ItemSize = New Size(43, 152)  
     Alignment = TabAlignment.Left  
     SizeMode = TabSizeMode.Fixed  
   End Sub  
   Protected Overrides Sub OnCreateControl()  
     MyBase.OnCreateControl()  
     SetStyle(ControlStyles.UserPaint, True)  
   End Sub  
   Protected Overrides Sub OnControlAdded(e As ControlEventArgs)  
     MyBase.OnControlAdded(e)  
     Try  
       For i As Integer = 0 To TabPages.Count - 1  
         TabPages(i).BackColor = Color.White  
         TabPages(i).ForeColor = Color.FromArgb(66, 79, 90)  
         TabPages(i).Font = GlobalFont(FontStyle.Regular, 10)  
       Next  
     Catch  
     End Try  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Color.FromArgb(66, 79, 90))  
     For i As Integer = 0 To TabPages.Count - 1  
       TabRect = GetTabRect(i)  
       If SelectedIndex = i Then  
         Using B As New SolidBrush(Color.FromArgb(52, 63, 72))  
           G.FillRectangle(B, TabRect)  
         End Using  
         FC = GreyColor(245)  
         Using B As New SolidBrush(Color.FromArgb(255, 175, 54))  
           G.FillRectangle(B, New Rectangle(TabRect.Location.X - 3, TabRect.Location.Y + 1, 5, TabRect.Height - 2))  
         End Using  
       Else  
         FC = GreyColor(192)  
         Using B As New SolidBrush(Color.FromArgb(66, 79, 90))  
           G.FillRectangle(B, TabRect)  
         End Using  
       End If  
       Using B As New SolidBrush(FC)  
         G.DrawString(TabPages(i).Text, GlobalFont(FontStyle.Regular, 10), B, New Point(TabRect.X + 50, TabRect.Y + 12))  
       End Using  
       If Not IsNothing(ImageList) Then  
         If Not TabPages(i).ImageIndex < 0 Then  
           G.DrawImage(ImageList.Images(TabPages(i).ImageIndex), New Rectangle(TabRect.X + 19, TabRect.Y + ((TabRect.Height / 2) - 10), 18, 18))  
         End If  
       End If  
     Next  
   End Sub  
 #End Region  
 End Class  
 <DefaultEvent("TextChanged")>  
 Class FirefoxTextbox  
   Inherits Control  
 #Region " Private "  
   Private WithEvents TB As New TextBox  
   Private G As Graphics  
   Private State As MouseState  
   Private IsDown As Boolean  
   Private _EnabledCalc As Boolean  
   Private _allowpassword As Boolean = False  
   Private _maxChars As Integer = 32767  
   Private _textAlignment As HorizontalAlignment  
   Private _multiLine As Boolean = False  
   Private _readOnly As Boolean = False  
 #End Region  
 #Region " Properties "  
   Public Shadows Property Enabled As Boolean  
     Get  
       Return EnabledCalc  
     End Get  
     Set(value As Boolean)  
       TB.Enabled = value  
       _EnabledCalc = value  
       Invalidate()  
     End Set  
   End Property  
   <DisplayName("Enabled")>  
   Public Property EnabledCalc As Boolean  
     Get  
       Return _EnabledCalc  
     End Get  
     Set(value As Boolean)  
       Enabled = value  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property UseSystemPasswordChar() As Boolean  
     Get  
       Return _allowpassword  
     End Get  
     Set(ByVal value As Boolean)  
       TB.UseSystemPasswordChar = UseSystemPasswordChar  
       _allowpassword = value  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property MaxLength() As Integer  
     Get  
       Return _maxChars  
     End Get  
     Set(ByVal value As Integer)  
       _maxChars = value  
       TB.MaxLength = MaxLength  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property TextAlign() As HorizontalAlignment  
     Get  
       Return _textAlignment  
     End Get  
     Set(ByVal value As HorizontalAlignment)  
       _textAlignment = value  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property MultiLine() As Boolean  
     Get  
       Return _multiLine  
     End Get  
     Set(ByVal value As Boolean)  
       _multiLine = value  
       TB.Multiline = value  
       OnResize(EventArgs.Empty)  
       Invalidate()  
     End Set  
   End Property  
   Public Shadows Property [ReadOnly]() As Boolean  
     Get  
       Return _readOnly  
     End Get  
     Set(ByVal value As Boolean)  
       _readOnly = value  
       If TB IsNot Nothing Then  
         TB.ReadOnly = value  
       End If  
     End Set  
   End Property  
 #End Region  
 #Region " Control "  
   Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)  
     MyBase.OnTextChanged(e)  
     Invalidate()  
   End Sub  
   Protected Overrides Sub OnBackColorChanged(ByVal e As EventArgs)  
     MyBase.OnBackColorChanged(e)  
     Invalidate()  
   End Sub  
   Protected Overrides Sub OnForeColorChanged(ByVal e As EventArgs)  
     MyBase.OnForeColorChanged(e)  
     TB.ForeColor = ForeColor  
     Invalidate()  
   End Sub  
   Protected Overrides Sub OnFontChanged(ByVal e As EventArgs)  
     MyBase.OnFontChanged(e)  
     TB.Font = Font  
   End Sub  
   Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)  
     MyBase.OnGotFocus(e)  
     TB.Focus()  
   End Sub  
   Private Sub TextChangeTb() Handles TB.TextChanged  
     Text = TB.Text  
   End Sub  
   Private Sub TextChng() Handles MyBase.TextChanged  
     TB.Text = Text  
   End Sub  
   Public Sub NewTextBox()  
     With TB  
       .Text = String.Empty  
       .BackColor = Color.White  
       .ForeColor = Color.FromArgb(66, 78, 90)  
       .TextAlign = HorizontalAlignment.Left  
       .BorderStyle = BorderStyle.None  
       .Location = New Point(3, 3)  
       .Font = GlobalFont(FontStyle.Regular, 10)  
       .Size = New Size(Width - 3, Height - 3)  
       .UseSystemPasswordChar = UseSystemPasswordChar  
     End With  
   End Sub  
   Sub New()  
     MyBase.New()  
     NewTextBox()  
     Controls.Add(TB)  
     SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)  
     DoubleBuffered = True  
     TextAlign = HorizontalAlignment.Left  
     ForeColor = Color.FromArgb(66, 78, 90)  
     Font = GlobalFont(FontStyle.Regular, 10)  
     Size = New Size(130, 29)  
     Enabled = True  
   End Sub  
   Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     If Enabled Then  
       TB.ForeColor = Color.FromArgb(66, 78, 90)  
       If State = MouseState.Down Then  
         DrawRoundRect(G, FullRectangle(Size, True), 3, Color.FromArgb(44, 156, 218))  
       Else  
         DrawRoundRect(G, FullRectangle(Size, True), 3, GreyColor(200))  
       End If  
     Else  
       TB.ForeColor = GreyColor(170)  
       DrawRoundRect(G, FullRectangle(Size, True), 3, GreyColor(230))  
     End If  
     TB.TextAlign = TextAlign  
     TB.UseSystemPasswordChar = UseSystemPasswordChar  
   End Sub  
   Protected Overrides Sub OnResize(e As EventArgs)  
     MyBase.OnResize(e)  
     If Not MultiLine Then  
       Dim tbheight As Integer = TB.Height  
       TB.Location = New Point(10, CType(((Height / 2) - (tbheight / 2) - 0), Integer))  
       TB.Size = New Size(Width - 20, tbheight)  
     Else  
       TB.Location = New Point(10, 10)  
       TB.Size = New Size(Width - 20, Height - 20)  
     End If  
   End Sub  
   Protected Overrides Sub OnEnter(e As EventArgs)  
     MyBase.OnEnter(e)  
     State = MouseState.Down : Invalidate()  
   End Sub  
   Protected Overrides Sub OnLeave(e As EventArgs)  
     MyBase.OnLeave(e)  
     State = MouseState.None : Invalidate()  
   End Sub  
 #End Region  
 End Class  
 Class FirefoxNumericUpDown  
   Inherits Control  
 #Region " Private "  
   Private G As Graphics  
   Private _Value As Integer  
   Private _Min As Integer  
   Private _Max As Integer  
   Private Loc As Point  
   Private Down As Boolean  
   Private _EnabledCalc As Boolean  
   Private ETC As Color = Nothing  
 #End Region  
 #Region " Properties "  
   Public Shadows Property Enabled As Boolean  
     Get  
       Return EnabledCalc  
     End Get  
     Set(value As Boolean)  
       _EnabledCalc = value  
       Invalidate()  
     End Set  
   End Property  
   <DisplayName("Enabled")>  
   Public Property EnabledCalc As Boolean  
     Get  
       Return _EnabledCalc  
     End Get  
     Set(value As Boolean)  
       Enabled = value  
       Invalidate()  
     End Set  
   End Property  
   Public Property Value As Integer  
     Get  
       Return _Value  
     End Get  
     Set(v As Integer)  
       If v <= _Max And v >= Minimum Then  
         _Value = v  
       End If  
       Invalidate()  
     End Set  
   End Property  
   Public Property Minimum As Integer  
     Get  
       Return _Min  
     End Get  
     Set(v As Integer)  
       If v < Maximum Then  
         _Min = v  
       End If  
       If Value < Minimum Then  
         Value = Minimum  
       End If  
       Invalidate()  
     End Set  
   End Property  
   Public Property Maximum As Integer  
     Get  
       Return _Max  
     End Get  
     Set(v As Integer)  
       If v > Minimum Then  
         _Max = v  
       End If  
       If Value > Maximum Then  
         Value = Maximum  
       End If  
       Invalidate()  
     End Set  
   End Property  
 #End Region  
 #Region " Control "  
   Sub New()  
     DoubleBuffered = True  
     Value = 0  
     Minimum = 0  
     Maximum = 100  
     Cursor = Cursors.IBeam  
     BackColor = Color.White  
     ForeColor = Color.FromArgb(66, 78, 90)  
     Font = GlobalFont(FontStyle.Regular, 10)  
     Enabled = True  
   End Sub  
   Protected Overrides Sub OnMouseMove(e As MouseEventArgs)  
     MyBase.OnMouseMove(e)  
     Loc.X = e.X  
     Loc.Y = e.Y  
     Invalidate()  
     If Loc.X < Width - 23 Then  
       Cursor = Cursors.IBeam  
     Else  
       Cursor = Cursors.Default  
     End If  
   End Sub  
   Protected Overrides Sub OnResize(ByVal e As EventArgs)  
     MyBase.OnResize(e)  
     Height = 30  
   End Sub  
   Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)  
     MyBase.OnMouseClick(e)  
     If Enabled Then  
       If Loc.X > Width - 21 AndAlso Loc.X < Width - 3 Then  
         If Loc.Y < 15 Then  
           If (Value + 1) <= Maximum Then  
             Value += 1  
           End If  
         Else  
           If (Value - 1) >= Minimum Then  
             Value -= 1  
           End If  
         End If  
       Else  
         Down = Not Down  
         Focus()  
       End If  
     End If  
     Invalidate()  
   End Sub  
   Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)  
     MyBase.OnKeyPress(e)  
     Try  
       If Down Then  
         Value = Value & e.KeyChar.ToString  
       End If  
       If Value > Maximum Then  
         Value = Maximum  
       End If  
     Catch  
     End Try  
   End Sub  
   Protected Overrides Sub OnKeyup(ByVal e As System.Windows.Forms.KeyEventArgs)  
     MyBase.OnKeyUp(e)  
     If e.KeyCode = Keys.Up Then  
       If (Value + 1) <= Maximum Then  
         Value += 1  
       End If  
       Invalidate()  
     ElseIf e.KeyCode = Keys.Down Then  
       If (Value - 1) >= Minimum Then  
         Value -= 1  
       End If  
     ElseIf e.KeyCode = Keys.Back Then  
       Dim BC As String = Value.ToString()  
       BC = BC.Remove(Convert.ToInt32(BC.Length - 1))  
       If (BC.Length = 0) Then  
         BC = "0"  
       End If  
       Value = Convert.ToInt32(BC)  
     End If  
     Invalidate()  
   End Sub  
   Protected Overrides Sub OnPaint(e As PaintEventArgs)  
     G = e.Graphics  
     G.SmoothingMode = SmoothingMode.HighQuality  
     G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit  
     MyBase.OnPaint(e)  
     G.Clear(Parent.BackColor)  
     If Enabled Then  
       ETC = Color.FromArgb(66, 78, 90)  
       Using P As New Pen(GreyColor(190))  
         DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(190))  
         G.DrawLine(P, New Point(Width - 24, 13.5F), New Point(Width - 5, 13.5F))  
       End Using  
       DrawRoundRect(G, New Rectangle(Width - 24, 4, 19, 21), 3, GreyColor(200))  
     Else  
       ETC = GreyColor(170)  
       Using P As New Pen(GreyColor(230))  
         DrawRoundRect(G, FullRectangle(Size, True), 2, GreyColor(190))  
         G.DrawLine(P, New Point(Width - 24, 13.5F), New Point(Width - 5, 13.5F))  
       End Using  
       DrawRoundRect(G, New Rectangle(Width - 24, 4, 19, 21), 3, GreyColor(220))  
     End If  
     Using B As New SolidBrush(ETC)  
       G.DrawString("t", New Font("Marlett", 8, FontStyle.Bold), B, New Point(Width - 22, 5))  
       G.DrawString("u", New Font("Marlett", 8, FontStyle.Bold), B, New Point(Width - 22, 13))  
       CenterString(G, Value, New Font("Segoe UI", 10), ETC, New Rectangle(Width / 2 - 10, 0, Width - 5, Height))  
     End Using  
   End Sub  
 #End Region  
 End Class  

Now just go click Build > Build Solution that's it, then you can find a set a of FireFix components in your ToolBox like this :


All the credits to : AeroRev9

How to Make a WIFI Hotspot Creator in VB.NET



You'll find many programs on the internet that can turn your Computer/Laptop Internet into a WIFI Hotspot but this ain't no any advanced like this. This is a very simple program to make a WIFI Hotspot using the Netsh command line scripting utility that comes with Windows.

Let's get into it...

Tools Required
  • 2 Textboxes
  • 2 Labels
  • 1 Checkbox
  • 2 Buttons
Change TEXT in the added Tools like given below
  • Label 1 - Hotspot Name:
  • Label 2 - Password: (8 Characters minimum)
  • CheckBox1 - Show Password
  • Button1 - Start
  • Button2 - Stop
Make sure your FORM looks like this :



Double click your Form to get into Form_Load Event and add this code to disable the Button2 (Stop)
 Button2.Enabled = False
Add this code for FormClosed Event to stop the Hotspot automatically when you close the program
Process.Start("CMD", "/C netsh wlan stop hostednetwork")
  Now go to Button1_Click and add these :

   Try  
       If TextBox1.Text = "" Then  
         MsgBox("Hotspot Name can't be empty", MsgBoxStyle.Critical)  
       End If  
       If TextBox2.TextLength < 8 Then  
         MsgBox("Password should be 8+ characters", MsgBoxStyle.Critical)  
         If TextBox2.Text = "" Then  
           MsgBox("Password can't be empty", MsgBoxStyle.Critical)  
         End If  
       Else  
         Dim process As New Process()  
         process.StartInfo.Verb = "runas"  
         process.StartInfo.UseShellExecute = True  
         process.Start("cmd", String.Format("/c {0} & {1} & {2}", "netsh wlan set hostednetwork mode=allow ssid=" & TextBox1.Text & " key=" & TextBox2.Text, "netsh wlan start hostednetwork", "pause"))  
         MsgBox("Hotspot started successfully", MsgBoxStyle.Information)  
         Button1.Enabled = False  
         Button2.Enabled = True  
       End If  
     Catch ex As Exception  
       MsgBox("Failed to establish a hotspot" & ex.Message, MsgBoxStyle.Information)  
     End Try  

Add this to Button2_Click :

   Button2.Enabled = False  
     Process.Start("CMD", "/C netsh wlan stop hostednetwork")  
     Button1.Enabled = True  
     MsgBox("Hotspot stopped successfully", MsgBoxStyle.Information)  

Finally just go add this piece of code to CheckBox1_Checked :

     If CheckBox1.CheckState = CheckState.Checked Then  
       TextBox2.UseSystemPasswordChar = False  
     End If  
     If CheckBox1.CheckState = CheckState.Unchecked Then  
       TextBox2.UseSystemPasswordChar = True  
     End If  

That's it! let's Run the program, Just set a Hotspot Name and a Password then click on Start


Now check your Phone or any other devices for WIFI connections, this is a screenshot from my Phone :


Hope it works fine with y'all...

How To Submit Software, Mobile App and Game On Softpedia

Softpedia Blue Background
Softpedia is a site where you can find computer programs and technology based articles. It's owned by SoftNews NET SRL, a Romanian company. It was launched in 2001. My programs have been reviewed by the Softpedia editors thrice. I submit my programs whenever they are ready to be released.

I have been asked a few times about this(how to submit..). It's pretty easy to submit your programs to Softpedia all you have to do is fill the form fields and submit.

They have different pages to submit for different platforms such as Windows, Linux, Mac etc.

Submit Windows Softpedia

Submit Games and Tools

Submit Mac OS Software

Submit Linux Software

Submit Mobile App

NOTE : you can submit your java programs in any section except Mobile.

Make sure you go to the right page, if you have a PAD file for your software already just fill the PAD form fields and submit if not fill the regular submission forms and submit. Don't forget to give your regular email address they'll send you an email when your program has been published.

How To Read A Text File Hosted Online To A String

 How To Read A TXT File Hosted Online To A String
So I got a email asking how to do this, I haven't done this before so went through some Google searches and found how to do this. It was pretty easy. I'll just share the code here maybe it'll be useful for someone.

You need these namespaces :
Imports System.IO
Imports System.Net

Event :
Dim TXT As String = "http://www.ultimateprogrammingtutorials.info/robots.txt"
Dim WC As WebClient = New WebClient()
Dim Read As StreamReader = New StreamReader(WC.OpenRead(TXT))
Dim STR As String = Read.ReadToEnd
TextBox1.Text = STR

  • Replace the TXT string value with your .txt link. 
  • You can also write into a richtextbox or whatever you want(I used textbox1 for example) 
I hope you learned something from this snippet.

Change Your Drive Icon With Drive Icon Changer 1.0

Drive Icon Changer 1.0 is a simple program that helps you to change/modify your Drive's icons with few clicks.

First select the Drive you wish to modify/change the icon, next browse and select an icon(.ICO) from your hard drive. The preview thing shows your a preview of the icon you selected. Finally click 'Change', it doesn't require a restart to effect. An explorer relaunch is enough to see the changes.

Requirements
  • Administrator rights
  • .NET Framework 2.0(download it from here)
  • Windows XP / Vista / Windows 7 / Windows 7 64 bit / Windows 8 / Windows 8 64 bit
Program Details
  • Developer : SHIM SOFTWARES(Mohamed Shimran)
  • Name : Drive Locker 1.0
  • Size : 763 KB
  • License : Freeware
  • Last Built : December 12th, 2013 
Download
Direct Download - https://www.dropbox.com/s/d160ew0d0fyqz3s/Drive%20Icon%20Changer.exe
Mirrors :
http://deepappsstore.weebly.com/drive-icon-changer.html

How To Login To Instagram Using The API In VB.NET

instagram picture
Instagram is a photo and video sharing app for smartphones, we can call it a social network. As I said It's a smartphone app but you can view photos, like photos, comment on photos and follow/unfollow users via their website from computer also there are more than 10 popular websites where you can view photos, like photos, comment on photos and follow/unfollow users, browse hashtags and view stats they use the API to do the works.

Without much talk let's get into it..

Remember you're just going to make a Instagram Login, you won't be able to view photos or do anything. You need two textbox and a button you can also add two labels to make it look good. The textbox1 is for username and textbox2 is for password.

Instagram Login form preview

Time for some codes...

Required Namespaces :
Imports System.IO
Imports System.Net
Imports System.Text

Functions(We need two functions) :
  
 Dim CC As New CookieContainer
    Dim RQ As HttpWebRequest
    Dim RP As HttpWebResponse
    Public Function GetResponse(ByVal url As String, ByVal referer As String) As String
        RQ = CType(HttpWebRequest.Create(url), HttpWebRequest)
        RQ.CookieContainer = CC

        If referer <> "" Then
            RQ.Referer = referer
        End If

        RP = CType(RQ.GetResponse(), HttpWebResponse)

        Return New StreamReader(RP.GetResponseStream()).ReadToEnd()
    End Function

    Public Function GetResponse(ByVal url As String, ByVal post As String, ByVal referer As String) As String
        RQ = CType(HttpWebRequest.Create(url), HttpWebRequest)
        RQ.Method = "POST"
        RQ.CookieContainer = CC
        RQ.UserAgent = "AppleWebKit/537.36 (KHTML, like Gecko) Mozilla/5.0 (Windows NT 6.1) Chrome/28.0.1468.0 Safari/537.36"

        If referer <> "" Then
            RQ.Referer = referer
        End If

        Dim byteArr() As Byte = Encoding.Default.GetBytes(post)
        RQ.ContentLength = byteArr.Length

        Dim dataStream As Stream = RQ.GetRequestStream()
        dataStream.Write(byteArr, 0, byteArr.Length)

        RP = CType(RQ.GetResponse(), HttpWebResponse)

        Return New StreamReader(RP.GetResponseStream()).ReadToEnd()
    End Function

This code is for your login button :
Dim html As String = GetResponse("https://instagram.com/accounts/login/", "")
        Dim token As String = html.Substring(html.IndexOf("csrfmiddlewaretoken")).Split(""""c)(2)
        Dim username As String = TextBox1.Text
        Dim password As String = TextBox2.Text

        Dim S_B As New StringBuilder
        S_B.Append("csrfmiddlewaretoken=" & token)
        S_B.Append("&username=" & username)
        S_B.Append("&password=" & password)

        html = GetResponse("https://instagram.com/accounts/login/", S_B.ToString, "https://instagram.com/accounts/login/")

        If html.Contains("""username"":""" & username) Then
            MsgBox("Successfully Logged In", MessageBoxIcon.Information)
        ElseIf html.Contains("Please enter a correct username and password.") Then
            MsgBox("Invalid Username or Password", MessageBoxIcon.Error)
        Else
            MsgBox("Unable Login Error", MessageBoxIcon.Error)
        End If


Now run the program and test it..

If you enter correct login credentials you will get this message :

How To Login To Instagram Using The API In VB.NET

I am looking to develop a Instagram picture view if everything goes well I will let you all know. Follow me on Instagram @54j33dh4.

How To Get Environment Variables In VB.NET and C#


Environment
Environment Variables are set of values that are used for running special processes or special system files.. for example when you install java or python you must make a new environment variable in order to compile and run java or python programs that's all I know about it. Without wasting anytime let's get into it...

This is a simple code that will show you the environment variables..

For VB.NET

        Dim EV As String = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process Or EnvironmentVariableTarget.Machine)

        MsgBox(EV)

For C#

'you must add these namespaces 

using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;

'add this code in an event 
string EV = Environment.GetEnvironmentVariable("PATH", 
                EnvironmentVariableTarget.Process | 
                EnvironmentVariableTarget.Machine);
            MessageBox.Show(EV);

The "PATH" defines the environment variable name so if you want to get another ones just change PATH with the variable name.

How To Check If Directory Exists In VB.NET And C#

directory in programming
I have had some hard times in solving this problem not these days but sometime ago when I started programming so I think this would be helpful for anyone who has started programming..

Here's the code to check if the directory exists in VB.NET :

Try
            If System.IO.Directory.GetDirectories("PATH").Length > 0 Then
                MsgBox("directory exists")

            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

All you need to do is replace PATH with the directory you want to check... length > 0 identifies if the directory exists.

Here's the code for C# :

try
            {
                if (System.IO.Directory.GetDirectories("PATH").Length > 0)
                {
                    MessageBox.Show("directory exists");

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

Do the same thing as given for VB.NET code.

How To Get The MD5 Hash Of A File In VB.NET

MD5 UPTUTORIALS
MD5 is a widely used cryptographic algorithm that produces a 128-BIT hash value. I think all the files you have in your computer has a unique md5 hash.. in some virus scanning process the files get identified easily with the hash value. Today we are going to make a simple application that will help you to get the md5 hash of any file.

Start a new project and do the traditions lol.. you must add a button, a label and a textbox.

user interface :)

You must add these namespaces before you could do any coding :

Imports System.Security.Cryptography
Imports System.IO
Imports System.Text

Here's the code for the application it's all under button click event.. I have explained the basic things by small comments.

  'creating the openfiledialog
        Dim Open As OpenFileDialog = New OpenFileDialog
        Open.Filter = "All Files (*.*)|*.*"
        If (Open.ShowDialog() = DialogResult.OK) Then TextBox1.Text = Open.FileName
        If Open.FileName = "" Then Exit Sub

        'accessing file & getting the hash
        Dim RD As FileStream = New FileStream(TextBox1.Text, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
        RD = New FileStream(TextBox1.Text, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
        Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
        md5.ComputeHash(RD)
        RD.Close()

        'converting the bytes into string
        Dim hash As Byte() = md5.Hash
        Dim SB As StringBuilder = New StringBuilder
        Dim HB As Byte
        For Each HB In hash
            SB.Append(String.Format("{0:X1}", HB))
        Next
        LabelHash.Text = "MD5 : " & SB.ToString()

The usage is pretty easy all you have to do is select and load the file from the button and you will get the Md5 hash for the selected file in the Label.

How To Use TinyURL API In VB.NET

TinyURL Icon Ultimate Programming TutorialsTinyURL is a URL shortening service a web service that provides short URLs for redirection of long URLs. This can be achieved very easily in PHP, I posted a PHP snippet about this you could reach it from here. Last year I created a TinyURL shortener I named it TinyURL Desktop App you can download it from here if you want. I found the source code of TinyURL Desktop App just now that's why I am writing this hehe. I used Devcomponents in my TinyURL Desktop App also I didn't handle exceptions because I was a noob then :0.

Down For Everyone Or Just Me in VB.NET

Down for everyone or just me is a website that can check whether your website is down or up.

Required components
  • One Button
  • One TextBox
Coding :
Add these codes to Button click_event & don't forget to add the namespace Imports System.Net.
    
'Imports System.Net
 'defining strin as a string & setting it to download strings from the website & the URL
        Dim strin As String = New WebClient().DownloadString(("http://downforeveryoneorjustme.com/" + TextBox1.Text))
        'checking string
        If strin.Contains("It's just you.") Then
            'return
            MsgBox(TextBox1.Text + " is up", MessageBoxIcon.Information, MessageBoxButtons.OK)
            'checking string
        ElseIf strin.Contains("It's not just you!") Then
            'return
            MsgBox(TextBox1.Text + " is down", MessageBoxIcon.Information, MessageBoxButtons.OK)
            'checking string
        ElseIf strin.Contains("Huh?") Then
            'return
            MsgBox("Invalid website", MessageBoxIcon.Error, MessageBoxButtons.OK)
        End If
Now to check you can just enter the URL you want to check in TextBox and click on the Button you added.

How To Make A Lyrics Fetcher In VB.NET

Description of the program : You can get the lyrics of songs with the artist name & the song name from this program.

 As usual just create a new fresh project and add the following tools to your form

  • 2 Buttons
  • 2 TextBoxes
  • 1 RichTextBox
  • 1 SaveFileDialog
Usage of the tools that you have added(Don't forget to change the buttons text : 
  1. Button1 - Fetch
  2. Button2 - Save
  3. TextBox1 - Artist Name
  4. TextBox2 - Song Name
  5. RichTextBox1 - Lyrics
You have to add System.Web reference, select add reference from project menu then search for it and click ok :

Adding reference to VB.NET

How To Force/Prompt Your C# & VB.NET Program To Run As Administrator

If your code will target or access secured files or libraries, then your program needs Administrator Privilege. It's easy to run your program as Administrator, simply you can right click your program and select run as administrator, and in C# & VB.NET theres a XML Manifest that tells the .NET Framework to prompt the user to run the program as Administrator, we can easily configure your program to prompt the user to run the program as administrator.

How to configure your program to prompt the user to run your program as Administrator?

1 : Go to Project(in your visual studio menustrip) and select Add New Item(or simply CTRL+SHIFT+A shortcut to open Add New Item)

outling





















2 : Choose Application Manifest File and click add(actually your debug folder has a manifest file but we are adding a new one)
man

























3 : You will find a new file in your Solution Explorer called app.manifest and you will fall into that file automatically lol, inside that file you would have some text(of course XML)

  
  
    
      
        
        
      
    
  

  
    
      

      
      

      
      

      
      

    
  

  
  


4 : Inside that file find  <requestedExecutionLevel level="asInvoker" uiAccess="false" />

5 : Replace asInvoker with requireAdministrator

6 : That's all

Now whenever you run your program, your program will prompt to run the program as Administrator.

How To Make A EICAR-Test-File In VB.NET

The EICAR Standard Anti-Virus Test File or EICAR test file is a computer file that was developed by the European Institute for Computer Antivirus Research (EICAR) and Computer Antivirus Research Organization (CARO), to test the response of computer antivirus (AV) programs. - Wikipedia
It's really easy to build a EICAR-Test-File in VB.NET because it has 68 ASCII characters which makes the file get detected as virus so what we are going to make is very simple, we are going to write those characters into a EXECUTABLE file.

The ASCII Characters X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

Just add a button to your form or write down on any events
'Don't forget to add Imports System.IO namespace
'By Mohamed Shimran
   Dim File As Integer
        Dim Text As String
        File = FreeFile()
        Text = "X5O!P" & Chr(37) & Chr(64) & "AP[4\PZX54(P^)7CC)7}" & Chr(36) & Chr(69) & Chr(73) & "CAR-STANDARD-ANTIVIRUS-TEST-FILE!" & Chr(36) & "H+H*"
        Dim save As New SaveFileDialog
        save.Filter = "Executable Files'(*.exe)|*.exe"
        save.ShowDialog()
            Dim strwrt As New StreamWriter(save.FileName)
            strwrt.Write(Text)
            strwrt.Close()
As you can see we have a string,integer & a savefiledialog declared so it writes the ASCII chracters to the exe file using stream write.

I have saved the exe file and here my avast pops up
EICAR
I hope you enjoyed this tutorial.

How To Use Spell Checker WPF In VB.NET

How To Use Spell Checker WPF In VB.NET
I started WPF in vb.net and soon I will move to c# by the way this the first tutorial in Ultimate programming tutorials about WPF so be cool first of all WPF means windows presentation foundation as i know WPF is really cool . so to get started Start A new project and select WPF
How To Use Spell Checker WPF In VB.NET

so then you will see two items called Application.xaml and MainWindow.xaml in your right side bar where you see your forms and resources . go to MainWindow.xaml and double click it and you will see something alike form and you will have these codes

How To Hide Internet Explorer Script Errors In VB.NET & C#

internet explorer
I think most of the people hate web browser control script errors in vb.net and c# . if you don't know what i mean , look at the picture below i hope you know it.
Internet error script
Okay i will straightly come to the main point ! you just need to add this line of code in form_load 
   Me.WebBrowser1.ScriptErrorsSuppressed = True
'change WebBrowser1 to your webbrowser name' , here is the code for c#
            this.webBrowser1.ScriptErrorsSuppressed = true;
that's a snippet , thanks.

How To Make A Proxy Grabber In VB.NET

How To Make A Proxy Grabber In VB.NET
Okay now we are going to make a proxy grabber , so what is this proxy grabber thing ? first of all proxy is something that covers your ip address(it's like you put a jacket when snow falls lol ) and grabber ? grabber is  meant for something that will fetch you things or whatever it's called . For this tutorial we are using websites that provides proxies so we use httpwebrequest and grab the proxies from the website and we check for the right format by using regex .

Let's start ,
First go ahead and create a new project and we need a ListBox and Three Buttons so just add them . After adding them to your form arrange as you see in the below picture.
How To Make A Proxy Grabber In VB.NET
Now coming to the coding point , first add Imports System.Text.RegularExpressions namespace because we use regex as i said before , first open the button click event which is the grab button and add this codes.
 'creating our httpwebrequest target NOTE: you can use any websites that use to provide proxies directly
        Dim the_request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://proxy-ip-list.com")
        'creating the httpwebresponce
        Dim the_response As System.Net.HttpWebResponse = the_request.GetResponse
        'defining the stream reader to read the data from the httpwebresponse
        Dim stream_reader As System.IO.StreamReader = New System.IO.StreamReader(the_response.GetResponseStream())
        'defining a string to stream reader fisnished streaming
        Dim code As String = stream_reader.ReadToEnd
        'haha here we use the regex
        Dim expression As New System.Text.RegularExpressions.Regex("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,4}")
        'adding the proxies to the listbox
        Dim mtac As MatchCollection = expression.Matches(code)
        For Each itemcode As Match In mtac
            ListBox1.Items.Add(itemcode)
        Next
After the first button we will see the second button which save.
   If ListBox1.Items.Count = (0) Then
            MessageBox.Show("Please click grab to grab proxies and then try saving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            'defining a streamwriter
            Dim S_W As IO.StreamWriter
            'converting listbox items to string
            Dim itms() As String = {ListBox1.Items.ToString}
            ''defining a savefiledialog
            Dim save As New SaveFileDialog
            Dim it As Integer
            save.FileName = "Grabbed Proxies"
            save.Filter = "Grabbed Proxies (*.txt)|*.txt|ALL Files (*.*)|*.*"
            save.CheckPathExists = True
            save.ShowDialog(Me)
            S_W = New IO.StreamWriter(save.FileName)
            For it = 0 To ListBox1.Items.Count - 1
                S_W.WriteLine(ListBox1.Items.Item(it))
            Next
            S_W.Close()
        End If
At last we need to add a line of code to clear the listbox which is
        ListBox1.Items.Clear()

Finally debug your program and test test .. How To Make A Proxy Grabber In VB.NET
YAY it's working ,I have explained the code by commenting over the codes and i hope this is helpful . thanks

Influence Theme - Dark Theme For VB.NET

influence theme
I have been using this Influence theme from a little longer time and it's really impressive than other themes. I hope you will like this theme .

How To Set .NET Framework Target For VB.NET and C# Projects

I heard that many people don't know how to change the .NET Framework target in their projects or they don't know why their programs don't work on others pc who don't have the .NET Framework that you use  so i wanted to write an article about changing the Framework so , i think everyone should target their .NET Framework to the older version because not everyone have the latest .NET Framework ; i always target my Framework to .NET 2.0 because most of the people have .NET Framework 2.0 . There is a small problem in changing your .NET Framework , if you use any latest libraries or maybe algorithms that are not compatible with older versions of .NET Framework then when you change the Framework Target it will show lots of error . I will come to the point now changing the .NET Framework is easy by the way i would like to say that it's better to change the .NET Framework target when you just started the project and don't think to change the .NET Framework in the middle of your project or in a finished project because there is a chance of your project getting corrupted .