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
QHTML 2.0 - frmImage.vb

frmImage.vb

Caricato da: Totem
Scarica il programma completo

  1. Imports QHTML.frmQHTML
  2. Imports QHTML.frmNew
  3. Public Class frmImage
  4.     Private Sub cmdBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBrowse.Click
  5.         If FOpen.ShowDialog = Windows.Forms.DialogResult.OK Then
  6.             txtIMG.Text = FOpen.FileName
  7.             imgPreview.Image = Drawing.Bitmap.FromFile(FOpen.FileName)
  8.         End If
  9.     End Sub
  10.     Private Sub chbHeight_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbHeight.CheckedChanged
  11.         nudHeight.Enabled = chbHeight.Checked
  12.     End Sub
  13.     Private Sub chbWidth_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbWidth.CheckedChanged
  14.         nudWidth.Enabled = chbWidth.Checked
  15.     End Sub
  16.  
  17.     Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
  18.         Dim Result As String = "<p align=" + Quote + dudAlign.SelectedItem + Quote + ">" + vbCrLf + "  <img"
  19.  
  20.         If chbHeight.Checked Then
  21.             Result += " height=" + quote & nudHeight.Value & quote
  22.         End If
  23.         If chbWidth.Checked Then
  24.             Result += " width=" + Quote & nudWidth.Value & Quote
  25.         End If
  26.  
  27.         If txtIMG.Text <> Nothing Then
  28.             If Not IsUrl(txtIMG.Text) Then
  29.                 txtIMG.Text = LocalToFile(txtIMG.Text)
  30.             End If
  31.         Else
  32.             MsgBox("Indirizzo dell'immagine non specificato!", MsgBoxStyle.Exclamation)
  33.             Exit Sub
  34.         End If
  35.         Result += " src=" + Quote + txtIMG.Text + Quote
  36.         Result += " alt=" + Quote + txtTip.Text + Quote
  37.         Result += " longdesc=" + Quote + txtLong.Text + Quote
  38.         Result += " border=" + Quote & nudBorder.Value & Quote
  39.         Result += " align=" + Quote + dudAlign.SelectedItem + Quote + "></p>" + vbCrLf
  40.  
  41.         InsertTAG(Result)
  42.  
  43.         Me.Close()
  44.     End Sub
  45.     Private Sub frmImage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  46.         dudAlign.SelectedIndex = 0
  47.     End Sub
  48. End Class