Imports QHTML.frmQHTML
Imports QHTML.frmNew
Public Class frmImage
Private Sub cmdBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBrowse.Click
If FOpen.ShowDialog = Windows.Forms.DialogResult.OK Then
txtIMG.Text = FOpen.FileName
imgPreview.Image = Drawing.Bitmap.FromFile(FOpen.FileName)
End If
End Sub
Private Sub chbHeight_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbHeight.CheckedChanged
nudHeight.Enabled = chbHeight.Checked
End Sub
Private Sub chbWidth_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbWidth.CheckedChanged
nudWidth.Enabled = chbWidth.Checked
End Sub
Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
Dim Result As String = "<p align=" + Quote + dudAlign.SelectedItem + Quote + ">" + vbCrLf + " <img"
If chbHeight.Checked Then
Result += " height=" + quote & nudHeight.Value & quote
End If
If chbWidth.Checked Then
Result += " width=" + Quote & nudWidth.Value & Quote
End If
If txtIMG.Text <> Nothing Then
If Not IsUrl(txtIMG.Text) Then
txtIMG.Text = LocalToFile(txtIMG.Text)
End If
Else
MsgBox("Indirizzo dell'immagine non specificato!", MsgBoxStyle.Exclamation)
Exit Sub
End If
Result += " src=" + Quote + txtIMG.Text + Quote
Result += " alt=" + Quote + txtTip.Text + Quote
Result += " longdesc=" + Quote + txtLong.Text + Quote
Result += " border=" + Quote & nudBorder.Value & Quote
Result += " align=" + Quote + dudAlign.SelectedItem + Quote + "></p>" + vbCrLf
InsertTAG(Result)
Me.Close()
End Sub
Private Sub frmImage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dudAlign.SelectedIndex = 0
End Sub
End Class