منتدى استراحات زايد

منتدى استراحات زايد (http://vb.ma7room.com/index.php)
-   منتدى أخبار المواقع والمنتديات العربية والأجنبية (http://vb.ma7room.com/forumdisplay.php?f=183)
-   -   مشروع برنامج راديو محطات قرآنية ومتصفح للجرائد المصرية (http://vb.ma7room.com/showthread.php?t=2083428)

محروم.كوم 08-31-2016 11:30 PM

مشروع برنامج راديو محطات قرآنية ومتصفح للجرائد المصرية
 
<div>مشروع برنامج راديو محطات قرآنية لكبار القراء ومتصفح للجرائد المصرية بسيط جدا ببرنامج Visual Basic 6
يتكون المشروعمن عدد 2 فورم
نضع على الفورم رقم 1
عدد 2 ليست بوكس
عدد 1 ميدا بلير
عدد3 ازرار play
pause
stop
news

الفورم الثانى نضعليه عدد 2 ليست بوكس
عدد1 Webbrowser
عدد 3 ازرار
back
forward
referch
stop
Go
textbox

Cod: copy and past
كود الفورم الأول

Form1
Option Explicit


' Note that this example does not scale controls within
' other controls. For example, if you place a TextBox
' inside a PictureBox, the TextBox's position and
' dimensions are relative to the PictureBox not the
' form. This example does not handle this case.
'
' It also does not adjust fonts, stretch pictures, etc.


Private Type ControlPositionType
Left As Single
Top As Single
Width As Single
Height As Single
FontSize As Single
End Type


Private m_ControlPositions() As ControlPositionType
Private m_FormWid As Single
Private m_FormHgt As Single
' Save the form's and controls' dimensions.
Private Sub SaveSizes()
Dim i As Integer
Dim ctl As Control


' Save the controls' positions and sizes.
ReDim m_ControlPositions(1 To Controls.Count)
i = 1
For Each ctl In Controls
With m_ControlPositions(i)
If TypeOf ctl Is line Then
.Left = ctl.X1
.Top = ctl.Y1
.Width = ctl.X2 - ctl.X1
.Height = ctl.Y2 - ctl.Y1
Else
.Left = ctl.Left
.Top = ctl.Top
.Width = ctl.Width
.Height = ctl.Height
On Error Resume Next
.FontSize = ctl.Font.Size
On Error GoTo 0
End If
End With
i = i + 1
Next ctl


' Save the form's size.
m_FormWid = ScaleWidth
m_FormHgt = ScaleHeight
End Sub
Private Sub Add_Click(Index As Integer)

List1.AddItem (txtSearch.Text)
End Sub
Private Sub Command2_Click()
Form3.Show
End Sub

Private Sub Delete_Click(Index As Integer)
List1.RemoveItem (List1.ListIndex)
End Sub

Private Sub Exit_Click()
End
End Sub

Private Sub Form_Load()
SaveSizes
Dim ff As Long
Dim line As String
ff = FreeFile
Open App.Path & "\Data1.txt" For Input As #ff
Do While Not EOF(ff)
Line Input #ff, line

'make sure we're not adding a blank line

If Len(line) Then List1.AddItem line

Loop
Close #ff


Open App.Path & "\Data2.txt" For Input As #ff

Do While Not EOF(ff)
Line Input #ff, line

'make sure we're not adding a blank line

If Len(line) Then List2.AddItem line

Loop
Close #ff

End Sub
' Arrange the controls for the new size.
Private Sub ResizeControls()
Dim i As Integer
Dim ctl As Control
Dim x_scale As Single
Dim y_scale As Single


' Don't bother if we are minimized.
If WindowState = vbMinimized Then Exit Sub


' Get the form's current scale factors.
x_scale = ScaleWidth / m_FormWid
y_scale = ScaleHeight / m_FormHgt


' Position the controls.
i = 1
For Each ctl In Controls
With m_ControlPositions(i)
If TypeOf ctl Is line Then
ctl.X1 = x_scale * .Left
ctl.Y1 = y_scale * .Top
ctl.X2 = ctl.X1 + x_scale * .Width
ctl.Y2 = ctl.Y1 + y_scale * .Height
Else
ctl.Left = x_scale * .Left
ctl.Top = y_scale * .Top
ctl.Width = x_scale * .Width
If Not (TypeOf ctl Is ComboBox) Then
' Cannot change height of ComboBoxes.
ctl.Height = y_scale * .Height
End If
On Error Resume Next
ctl.Font.Size = y_scale * .FontSize
On Error GoTo 0
End If
End With
i = i + 1
Next ctl
End Sub


Private Sub Form_Resize()
ResizeControls
End Sub

Private Sub Command1_Click()
Form2.Show
Form1.Hide
End Sub


Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
WindowsMediaPlayer1.URL = List2
WindowsMediaPlayer1.Controls.Play
End Sub

Private Sub Mute_Click()
WindowsMediaPlayer1.settings.Mute = True
End Sub

Private Sub Pause_Click()
If Pause.Caption = "Pause" Then
Pause.Caption = "Resume"
WindowsMediaPlayer1.Controls.Pause
Else
Pause.Caption = "Pause"
WindowsMediaPlayer1.Controls.Play
End If


End Sub

Private Sub Play_Click()
WindowsMediaPlayer1.Controls.Play
End Sub
Private Sub txtSearch_Change()
Dim i As Integer

For i = 0 To List1.ListCount - 1
If InStr(List1.List(i), txtSearch.Text) > 0 Then
MsgBox "Item #" & (i + 1) & " is what you searched for"
'Select the found entry
List1.ListIndex = i
End If
Next
End Sub

Private Sub Stop_Click()
WindowsMediaPlayer1.Controls.Stop
End Sub


كود الفورم الثانى

Form2

Option Explicit


' Note that this example does not scale controls within
' other controls. For example, if you place a TextBox
' inside a PictureBox, the TextBox's position and
' dimensions are relative to the PictureBox not the
' form. This example does not handle this case.
'
' It also does not adjust fonts, stretch pictures, etc.


Private Type ControlPositionType
Left As Single
Top As Single
Width As Single
Height As Single
FontSize As Single
End Type


Private m_ControlPositions() As ControlPositionType
Private m_FormWid As Single
Private m_FormHgt As Single
' Save the form's and controls' dimensions.
Private Sub SaveSizes()
Dim i As Integer
Dim ctl As Control


' Save the controls' positions and sizes.
ReDim m_ControlPositions(1 To Controls.Count)
i = 1
For Each ctl In Controls
With m_ControlPositions(i)
If TypeOf ctl Is line Then
.Left = ctl.X1
.Top = ctl.Y1
.Width = ctl.X2 - ctl.X1
.Height = ctl.Y2 - ctl.Y1
Else
.Left = ctl.Left
.Top = ctl.Top
.Width = ctl.Width
.Height = ctl.Height
On Error Resume Next
.FontSize = ctl.Font.Size
On Error GoTo 0
End If
End With
i = i + 1
Next ctl


' Save the form's size.
m_FormWid = ScaleWidth
m_FormHgt = ScaleHeight
End Sub

Private Sub Back_Click()
WebBrowser1.GoBack
End Sub

Private Sub Form_Load()
Dim ff As Long
Dim line As String
ff = FreeFile
Open App.Path & "\Data3.txt" For Input As #ff
Do While Not EOF(ff)
Line Input #ff, line

'make sure we're not adding a blank line

If Len(line) Then List1.AddItem line

Loop
Close #ff


Open App.Path & "\Data4.txt" For Input As #ff

Do While Not EOF(ff)
Line Input #ff, line

'make sure we're not adding a blank line

If Len(line) Then List2.AddItem line

Loop
Close #ff
SaveSizes
End Sub
' Arrange the controls for the new size.
Private Sub ResizeControls()
Dim i As Integer
Dim ctl As Control
Dim x_scale As Single
Dim y_scale As Single


' Don't bother if we are minimized.
If WindowState = vbMinimized Then Exit Sub


' Get the form's current scale factors.
x_scale = ScaleWidth / m_FormWid
y_scale = ScaleHeight / m_FormHgt


' Position the controls.
i = 1
For Each ctl In Controls
With m_ControlPositions(i)
If TypeOf ctl Is line Then
ctl.X1 = x_scale * .Left
ctl.Y1 = y_scale * .Top
ctl.X2 = ctl.X1 + x_scale * .Width
ctl.Y2 = ctl.Y1 + y_scale * .Height
Else
ctl.Left = x_scale * .Left
ctl.Top = y_scale * .Top
ctl.Width = x_scale * .Width
If Not (TypeOf ctl Is ComboBox) Then
' Cannot change height of ComboBoxes.
ctl.Height = y_scale * .Height
End If
On Error Resume Next
ctl.Font.Size = y_scale * .FontSize
On Error GoTo 0
End If
End With
i = i + 1
Next ctl
End Sub


Private Sub Form_Resize()
ResizeControls
End Sub

Private Sub Forward_Click()
WebBrowser1.GoForward
End Sub

Private Sub Go_Click()
WebBrowser1.Navigate (Text1.Text)
End Sub

Private Sub Home_Click()
WebBrowser1.GoHome
End Sub

Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
WebBrowser1.Navigate (List2)
WebBrowser1.Silent = True

End Sub

Private Sub *******_Click()
WebBrowser1.*******
End Sub


الساعة الآن 05:15 AM

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227