Skip to content

Instantly share code, notes, and snippets.

View facebookegypt's full-sized avatar

Ahmed Samir facebookegypt

View GitHub Profile
Option Explicit
Global PicNm As String
Private Sub Timg_Click()
'Load pictures in Image control using CommonDialog method.
Cdl.Filter = ("Jpeg Jpg Photo Type (*.Jpg) |*.Jpg")
Cdl.CancelError = False
Cdl.DialogTitle = ("Choose a friend photo")
Cdl.ShowOpen
If Cdl.FileName = Trim("") Then
PicNm = App.Path & "/Phone1.Jpg"
Else
PicNm = ("")
Private Sub Form_Paint()
Dim MyPic As New StdPicture
Me.AutoRedraw = True
Set MyPic = LoadPicture(App.Path & "\Phone1.Jpg")
Me.PaintPicture MyPic, _
(Me.ScaleLeft + MyPic.Width) / 2, (Me.Height - MyPic.Height), _
, , , (Me.ScaleHeight - MyPic.Height)
End Sub
Private Sub Form_Load()
'In the Module (Evry1falls.bas)
'Sliding ==> effect to end the application.
Public Sub ExitEffect(Frm As Form, Espeed As Integer)
While Frm.Left + Frm.Width < Screen.Width
DoEvents
Frm.Left = Frm.Left + Espeed
Wend
While Frm.Top - Frm.Height < Screen.Height
DoEvents
Frm.Top = Frm.Top + Espeed
Public Sub Main()
'Add then lines at the end of the Module (evry1falls.bas)
'Prevent application from running again while is already running:
If App.PrevInstance = True Then
MsgBox "Can't run the application twice at the same time" & vbCrLf & _
"The application is already running", vbCritical, "Wrong move"
Exit Sub
End If
MainFrm.Show
End Sub
'Starts
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Imports System.Net
Class Form1
Dim PopHost As String
Dim UserName As String
Dim Password As String
@facebookegypt
facebookegypt / gist:5110622
Last active December 14, 2015 15:49
Send E-mail with vb.Net
'The Mail Class we use to send e-mails
Imports System.Net.Mail
'The form name : SendFrm
Public Class SendFrm
Dim SmtpSvr As New Net.Mail.SmtpClient()
Dim E_mail As New Net.Mail.MailMessage()
Dim UsrNm, Pwd, Srve As String
Dim Int_port As Integer
Private Sub SendFrm_Load (ByVal sender As System.Object, _
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Imports System.Net
Class Form1
Dim PopHost As String
Dim UserName As String
'Get Messages count
Dim server_Stat(2) As String
server_Stat = StatResp.Split(" ")
MsgCount.Text = server_Stat(1)
'Starts
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Imports System.Net
Class Form1
Dim PopHost As String