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
ASCII - Form1.frm

Form1.frm

Caricato da: Albertking82
Scarica il programma completo

  1. Private Sub Command1_Click()
  2.   Text1.MaxLength = 4
  3.  If mnucodasc.Checked = True Then
  4.   Text1.Text = Asc(Text1.Text)
  5.  End If
  6.  If mnucodchar.Checked Then
  7.   If Asc(Text1.Text) < 48 Or Asc(Text1.Text) < 58 Then
  8.    Text1.Text = Chr(Text1.Text)
  9.   Else
  10.    MsgBox "introduci un numero : Valore minimo 32-Valore massimo 255", vbInformation, "CODICE CHAR"
  11.    Text1.Text = ""
  12.   End If
  13.  End If
  14.   Command1.Enabled = False
  15. End Sub
  16.  
  17. Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  18.  If mnucodchar.Checked = True Then
  19.   Command1.ToolTipText = "codifica il carattere corrispondente al codice inserito"
  20.  Else
  21.   Command1.ToolTipText = "codifica il codice ascii del carattere inserito"
  22.  End If
  23. End Sub
  24.  
  25. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  26. If MsgBox("Sei sicuro di voler uscire?", vbYesNo, "esci") = vbNo Then
  27.  Cancel = True
  28.  Else
  29.  End
  30. End If
  31. End Sub
  32.  
  33. Private Sub mnucod_Click()
  34. Form2.Show
  35. End Sub
  36.  
  37. Private Sub mnucodasc_Click()
  38.  Form1.Caption = "codice ascii"
  39.  mnucodasc.Checked = True
  40.  mnucodchar.Checked = False
  41.  Command1.Caption = "codifica ascii"
  42.  Label1.Caption = "Inserisci il carattere"
  43. End Sub
  44.  
  45. Private Sub mnucodchar_Click()
  46.  Form1.Caption = "codice char"
  47.  mnucodasc.Checked = False
  48.  mnucodchar.Checked = True
  49.  Command1.Caption = "codifica char"
  50.  Label1.Caption = "Inserisci ascii"
  51. End Sub
  52.  
  53. Private Sub mnucolpul_Click()
  54. colori.ShowColor
  55. Command1.BackColor = colori.Color
  56. End Sub
  57.  
  58. Private Sub mnucolsfondo_Click()
  59. colori.ShowColor
  60. Form1.BackColor = colori.Color
  61. If Form1.BackColor = &HFF& Then
  62. Label1.ForeColor = vbBlack
  63. Else
  64. Label1.ForeColor = vbRed
  65. End If
  66. End Sub
  67.  
  68. Private Sub mnuexit_Click()
  69.  Dim ris As Integer
  70.  ris = MsgBox("Sei sicuro di voler uscire?", vbQuestion + vbYesNo, "exit")
  71.   If ris = vbYes Then
  72.    End
  73.   End If
  74. End Sub
  75.  
  76. Private Sub Text1_Change()
  77.  If Text1.Text = "" Then
  78.   Command1.Enabled = False
  79.   Else
  80.   Command1.Enabled = True
  81.  End If
  82.   If Command1.Enabled = True Then
  83.    mnucodasc.Enabled = False
  84.    mnucodchar.Enabled = False
  85.   Else
  86.    Command1.Enabled = False
  87.    mnucodasc.Enabled = True
  88.    mnucodchar.Enabled = True
  89.   End If
  90.  If mnucodasc.Checked = True Then
  91.   Text1.MaxLength = 1
  92.  End If
  93.  If mnucodchar.Checked = True Then
  94.  Text1.MaxLength = 3
  95.  End If
  96.  If Val(Text1.Text) > 255 Then
  97.   MsgBox "inserire un numero inferiore a 256"
  98.   Text1.Text = ""
  99.  End If
  100. End Sub
  101.  
  102. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
  103. If mnucodchar.Checked = True Then
  104.  Select Case KeyCode
  105.   Case 32
  106.    MsgBox "introduci un numero", vbCritical, "errore"
  107.    Text1.Text = ""
  108.    Case 48
  109.    MsgBox "introduci un numero", vbCritical, "errore"
  110.    Text1.Text = ""
  111.  
  112.   Case 106
  113.    MsgBox "introduci un numero", vbCritical, "errore"
  114.    Text1.Text = ""
  115.    Case 107
  116.    MsgBox "introduci un numero", vbCritical, "errore"
  117.    Text1.Text = ""
  118.   Case 109
  119.    MsgBox "introduci un numero", vbCritical, "errore"
  120.    Text1.Text = ""
  121.   Case 187
  122.    MsgBox "introduci un numero", vbCritical, "errore"
  123.    Text1.Text = ""
  124.     Case 188
  125.    MsgBox "introduci un numero", vbCritical, "errore"
  126.    Text1.Text = ""
  127.   Case 189
  128.    MsgBox "introduci un numero", vbCritical, "errore"
  129.    Text1.Text = ""
  130.      Case 190
  131.    MsgBox "introduci un numero", vbCritical, "errore"
  132.    Text1.Text = ""
  133.    Case 219
  134.    MsgBox "introduci un numero", vbCritical, "errore"
  135.    Text1.Text = ""
  136.   Case 220
  137.    MsgBox "introduci un numero", vbCritical, "errore"
  138.    Text1.Text = ""
  139.  End Select
  140. End If
  141.  
  142. End Sub