Skip to content

Instantly share code, notes, and snippets.

View facebookegypt's full-sized avatar

Ahmed Samir facebookegypt

View GitHub Profile
@facebookegypt
facebookegypt / gist:8824653
Created February 5, 2014 14:26
VB 2010 Read Text Files
'Visual basic online course
'Read Text Files in VB 2010
Private Sub Form1_Load(sender As System.Object, _
e As System.EventArgs) Handles MyBase.Load
'Path to file
Dim LocalFilePath As String = Application.StartupPath & "\MyFile.txt"
Dim fileReader As String
FileReader = My.Computer.FileSystem.ReadAllText(LocalFilePath,
System.Text.Encoding.ASCII)
@facebookegypt
facebookegypt / gist:8814319
Created February 4, 2014 23:10
VB 2010 Create New TextBox with Events
'Visual Basic Online Course
'2014
'VB 2010 Create TextBox Control at Run-Time with events
Public Class Form1
Public MyNewTXT As TextBox = New TextBox
Const FHEIGHT As Integer = 120
Const FWIDTH As Integer = 300
Dim PointX, PointY As Integer
@facebookegypt
facebookegypt / gist:8803339
Created February 4, 2014 13:13
VB 2010 Progress Bar
'Visual Basic Online Course
'VB 2010 Progress Bar
'Place this code in the Module section
Module Module1
Public ProBar1 As ProgressBar = New ProgressBar
End Module
'Place this code in your form [Form1]
Public Class Form1
@facebookegypt
facebookegypt / gist:8770476
Last active August 29, 2015 13:55
VB 2010 Insert InTo Values with Apostrophe from Variables
'Visual Basic Online Course
'VB 2010 Insert InTo Values with Apostrophe
Function SqlStrAps(ByVal ToStr As String) As String
SqlStrAps = "'" & Replace(ToStr, "'", "''") & "'"
End Function
'_OR, you can do this .
Dim SqlStr As String = _
"Insert Into Table_Name (Field1,Field2,Field3_With_Apostrophe)"
@facebookegypt
facebookegypt / gist:8761381
Last active August 29, 2015 13:55
Fade Image in VB 2010
'Visual Basic Online Course
'VB 2010 Fade Image
Imports System.Drawing.Imaging
Public Class Form1
Dim BMP As Bitmap
Dim ImgPath As String
Dim ofd As New OpenFileDialog
@facebookegypt
facebookegypt / gist:8718195
Created January 30, 2014 20:38
VB 2010 OOP Lesson - Classes Intro [Email Validation]
'Visual Basic Online Course - OOP
'OOP Lesson - Classes Intro
'Project : Email Validation
'Source : evry1.net/VBNet
Public Class Form1
Private Sub BtnValid_Click(sender As System.Object, _
e As System.EventArgs) Handles BtnValid.Click
Dim X, Y As Integer
X = TxtEmail.Text.IndexOf("@")
@facebookegypt
facebookegypt / gist:8623883
Created January 25, 2014 21:28
VB 2010 Add icon to the TreeView
'Visual Basic Online Course
'VB 2010 Add photo to Treeview
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
TRV1.ImageList = ImageList1
'Parent Node
TRV1.Nodes.Add(key:="Info", text:="First Name", imageIndex:=0)
'First Child Node
TRV1.Nodes(0).Nodes.Add(text:="Evry1falls", imageIndex:=1)
End Sub
@facebookegypt
facebookegypt / gist:8594514
Created January 24, 2014 09:33
@string resource solution 0
<!-- Android Development Solution -->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
@facebookegypt
facebookegypt / gist:8594489
Created January 24, 2014 09:31
@string resource solution
<!-- example: XML file saved at res/values/strings.xml: -->
<!-- Android Development Solution -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="yellow">Yellow</string>
</resources>
@facebookegypt
facebookegypt / gist:8434703
Created January 15, 2014 11:36
Visual Basic 2010 Command Prompt read / write
' --------------------------------------- '
' Visual Basic Online Course ------------ '
' By / evry1.net ------------------------ '
' on Jan, 2014 -------------------------- '
' Facebook : fb.com/Visual.Basic.Language '
' --------------------------------------- '
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim cmdInput As String = TextBox1.Text.Trim & "&"
Dim proc As New Process