Friday, January 23, 2026

VB.NET Windows Forms Tutorial For Beginner| Hello World MessageBox on Bu...


In this beginner-friendly VB.NET tutorial, you will learn how to create a Windows Forms application that displays a "Hello World" message when you click a button. In this video, we will cover: ✔ How to create a VB.NET Windows Forms project ✔ How to design a form and add a button ✔ How to write the Button Click event code ✔ How to display a MessageBox with Hello World This tutorial is perfect for beginners who want to learn VB.NET and Windows Forms step by step. By the end of this video, you'll have your first interactive VB.NET program running! ๐Ÿ”น Technologies used: - VB.NET - Windows Forms - Visual Studio ๐Ÿ‘ If you find this tutorial helpful, please **Like**, **Comment**, and **Subscribe** for more VB.NET tutorials. #vbnet #windowsforms #helloworld #messagebox #ButtonClick #vbnettutorial #programming #learnvbnet #visualbasic #beginnertutorials #vbnetprojects

Saturday, February 3, 2018

Datagridview sort

How to clear Datagridview

There is two ways to clear rows in datagridview :



1- When the datagridview is not assigned to Datasource :


            DataGridView1.Rows.Clear()



2- When the datagridview isassigned to Datasource :



           DataGridView1.DataSource = Nothing
           DataGridView1.DataMember = Nothing
           DataGridView1.Refresh()
 

 

Thursday, February 1, 2018

Print Datagridview





รงi dessous le code complet :

Imports System
Imports System.Text
Imports System.Windows.Forms
Imports System.Drawing

Public Class Form1

Private strFormat As StringFormat
Private arrColumnLefts As New ArrayList
Private arrColumnWidths As New ArrayList
Private iCellHeight As Integer = 0
Private iTotalWidth As Integer = 0
Private iRow As Integer = 0
Private bFirstPage As Boolean = False
Private bNewPage As Boolean = False
Private iHeaderHeight As Integer = 0

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DataGridView1.Rows.Add("0", "Iheb", "32", "IT Manager", "Tunisia")
DataGridView1.Rows.Add("1", "Sam", "32", "Teacher", "USA")
DataGridView1.Rows.Add("2", "Jhon", "22", "Student", "Philippine")
DataGridView1.Rows.Add("3", "David", "25", "Student", "UK")
End Sub

Private Sub printDocument1_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles PrintDocument1.BeginPrint

Try

strFormat = New StringFormat
strFormat.Alignment = StringAlignment.Near
strFormat.LineAlignment = StringAlignment.Center
strFormat.Trimming = StringTrimming.EllipsisCharacter