Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Morse - Form1.frm

Form1.frm

Caricato da: Netarrow
Scarica il programma completo

  1. Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
  2.  
  3. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  4.  
  5. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
  6.  
  7. Const EM_UNDO = &HC7
  8.  
  9. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  10.  
  11. Private Sub BrowserTo(frm As Form, URL As String)
  12.     Call ShellExecute(frm.hwnd, vbNullString, URL, vbNullString, vbNullString, 1)
  13. End Sub
  14.  
  15.  
  16. Private Sub about_SClick()
  17. MsgBox "Morse © by netarrow 2003", , "About"
  18. End Sub
  19.  
  20. Private Sub about_Click()
  21. MsgBox "Morse © by netarrow 2003", vbInformation, "About"
  22. End Sub
  23.  
  24. Private Sub Command1_Click()
  25. On Error GoTo error
  26. Command1.Enabled = False
  27. Dim per As Integer
  28. Dim a As Long
  29. For a = 1 To Len(Text2.Text)
  30. per = 100 * a / Len(Text2.Text)
  31. If Mid(Text2.Text, a, 1) = "." Then
  32. Label3.Caption = per & "%"
  33. Sleep 500
  34. Label3.Caption = per & "%"
  35. p.Picture = LoadPicture("punto.jpg")
  36. Label3.Caption = per & "%"
  37. Sleep 500
  38. Label3.Caption = per & "%"
  39. p.Picture = LoadPicture("1.jpg")
  40. Label3.Caption = per & "%"
  41. ElseIf Mid(Text2.Text, a, 1) = "-" Then
  42. Label3.Caption = per & "%"
  43. Sleep 500
  44. Label3.Caption = per & "%"
  45. p.Picture = LoadPicture("linea.jpg")
  46. Label3.Caption = per & "%"
  47. Sleep 500
  48. Label3.Caption = per & "%"
  49. p.Picture = LoadPicture("1.jpg")
  50. Label3.Caption = per & "%"
  51. Else
  52. Label3.Caption = per & "%"
  53. Sleep 500
  54. Label3.Caption = per & "%"
  55. p.Picture = LoadPicture("1.jpg")
  56. Label3.Caption = per & "%"
  57. End If
  58. Next a
  59. Command1.Enabled = True
  60. Exit Sub
  61. error:
  62. If Err.Number = 53 Then
  63. MsgBox "Non trovo le immagini, mettere 1.jpg, linea.jpg e punto.jpg vicono all'exe", vbCritical, "Errore"
  64. End If
  65. End Sub
  66.  
  67. Private Sub Command2_Click()
  68. Command1.Enabled = False
  69. Command2.Enabled = False
  70. Command1.Enabled = True
  71. End Sub
  72.  
  73. Private Sub copi_Click()
  74. On Error GoTo error
  75. Clipboard.SetText Text2.Text
  76. Exit Sub
  77. error:
  78. MsgBox "E' avvenuto un errore", vbCritical, "Errore"
  79. End Sub
  80.  
  81. Private Sub Exit_Click()
  82. Unload Me
  83. End Sub
  84.  
  85. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  86. If MsgBox("Sei sicuro di voler uscire?", vbYesNo, "Morse") = vbNo Then
  87. Cancel = True
  88. Else
  89. End
  90. End If
  91. End Sub
  92.  
  93. Private Sub morse_Click()
  94. On Error GoTo er
  95. BrowserTo Me, "morse.htm"
  96. Exit Sub
  97. er:
  98. MsgBox "Tenere morse.html e l'activeX vinici all'exe", vbCritical, "Errore"
  99. End Sub
  100.  
  101. Private Sub nbmf_Click()
  102. On Error GoTo error
  103. Text1.Text = Clipboard.GetText
  104. Exit Sub
  105. error:
  106. MsgBox "E' avvenuto un errore", vbCritical, "Errore"
  107. End Sub
  108.  
  109. Private Sub qew_Click()
  110. Text1.Text = LCase(Text1.Text)
  111. For i = 1 To Len(Text1.Text)
  112. Select Case Mid(Text1.Text, i, 1)
  113. Case "a"
  114. Text2.Text = Text2.Text & ".-/"
  115. Case "à"
  116. Text2.Text = Text2.Text & ".-/"
  117. Case "b"
  118. Text2.Text = Text2.Text & "-.../"
  119. Case "c"
  120. Text2.Text = Text2.Text & "-.-./"
  121. Case "d"
  122. Text2.Text = Text2.Text & "-../"
  123. Case "e"
  124. Text2.Text = Text2.Text & "./"
  125. Case "è"
  126. Text2.Text = Text2.Text & "./"
  127. Case "f"
  128. Text2.Text = Text2.Text & "..-./"
  129. Case "g"
  130. Text2.Text = Text2.Text & "--./"
  131. Case "h"
  132. Text2.Text = Text2.Text & "..../"
  133. Case "i"
  134. Text2.Text = Text2.Text & "../"
  135. Case "ì"
  136. Text2.Text = Text2.Text & "../"
  137. Case "j"
  138. Text2.Text = Text2.Text & ".--/"
  139. Case "k"
  140. Text2.Text = Text2.Text & "-.-/"
  141. Case "l"
  142. Text2.Text = Text2.Text & ".-../"
  143. Case "m"
  144. Text2.Text = Text2.Text & "--/"
  145. Case "n"
  146. Text2.Text = Text2.Text & "-./"
  147. Case "o"
  148. Text2.Text = Text2.Text & "---/"
  149. Case "ò"
  150. Text2.Text = Text2.Text & "---/"
  151. Case "p"
  152. Text2.Text = Text2.Text & ".--./"
  153. Case "q"
  154. Text2.Text = Text2.Text & "--.-/"
  155. Case "r"
  156. Text2.Text = Text2.Text & ".-./"
  157. Case "s"
  158. Text2.Text = Text2.Text & ".../"
  159. Case "t"
  160. Text2.Text = Text2.Text & "-/"
  161. Case "u"
  162. Text2.Text = Text2.Text & "..-/"
  163. Case "ù"
  164. Text2.Text = Text2.Text & "..-/"
  165. Case "v"
  166. Text2.Text = Text2.Text & "...-/"
  167. Case "w"
  168. Text2.Text = Text2.Text & ".--/"
  169. Case "x"
  170. Text2.Text = Text2.Text & "-..-/"
  171. Case "y"
  172. Text2.Text = Text2.Text & "-.--/"
  173. Case "z"
  174. Text2.Text = Text2.Text & "--../"
  175. Case "1"
  176. Text2.Text = Text2.Text & ".----/"
  177. Case "2"
  178. Text2.Text = Text2.Text & "..--/"
  179. Case "3"
  180. Text2.Text = Text2.Text & "...--/"
  181. Case "4"
  182. Text2.Text = Text2.Text & "....-/"
  183. Case "5"
  184. Text2.Text = Text2.Text & "...../"
  185. Case "6"
  186. Text2.Text = Text2.Text & "-..../"
  187. Case "7"
  188. Text2.Text = Text2.Text & "--.../"
  189. Case "8"
  190. Text2.Text = Text2.Text & "-../"
  191. Case "9"
  192. Text2.Text = Text2.Text & "----./"
  193. Case "0"
  194. Text2.Text = Text2.Text & "----/"
  195. Case " "
  196. Text2.Text = Text2.Text & " "
  197. End Select
  198. Next i
  199. End Sub
  200.  
  201. Private Sub reset_Click()
  202. a.Enabled = True
  203. Text1.Text = ""
  204. Text2.Text = ""
  205. End Sub
  206.  
  207. Private Sub save_Click()
  208. Form3.Show
  209. End Sub
  210.  
  211. Private Sub vhjn_Click()
  212. Form2.Show
  213. End Sub