ShowTextDlg Example for Visual Basic

 
Private Sub Text_Click()
	Dim RasterEfxDlg As New LEADRasterDlgEfx_U
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim nRet As Integer

	RasterKrnDlg.InitDlg 0
	RasterEfxDlg.Text.SampleText = "Lead Tools"
	RasterEfxDlg.Text.Color = RGB(0, 0, 255)
	RasterEfxDlg.Text.HiliteColor = RGB(255, 255, 255)
	RasterEfxDlg.Text.ShadowColor = RGB(128, 128, 128)
	RasterEfxDlg.Text.TextStyle = EFX_TEXTSTYLE_NORMAL
	RasterEfxDlg.Text.Align = EFX_TEXTALIGN_LEFT_TOP
	RasterEfxDlg.Text.WordWrap = False
	RasterEfxDlg.Text.Angle = 450
	RasterEfxDlg.Text.ShadowXDepth = 10
	RasterEfxDlg.Text.ShadowYDepth = 10
	RasterEfxDlg.Text.EnableUseForegroundImage = True

	RasterEfxDlg.UIFlags = TEXT_SHOW_PREVIEW Or _
						  TEXT_SAMPLETEXT Or _
						  TEXT_STYLE Or _
						  TEXT_COLOR Or _
						  TEXT_BORDERCOLOR Or _
						  TEXT_ALIGN Or _
						  TEXT_ANGLE Or _
						  TEXT_WORDWRAP Or _
						  TEXT_FONT Or _
						  TEXT_FOREIMAGE Or _
						  TEXT_BROWSEIMAGE Or _
						  TEXT_SHADOWCOLOR Or _
						  TEXT_SHADOW_X_Y

	RasterEfxDlg.Bitmap = LEAD1.Bitmap
	nRet = RasterEfxDlg.ShowTextDlg(hWnd)
		 
	Text1.Text = RasterEfxDlg.Text.SampleText
	Text2.Text = CStr(RasterEfxDlg.Text.Angle)
	Text3.Text = CStr(RasterEfxDlg.Text.TextStyle)
	Text4.Text = CStr(RasterEfxDlg.Text.Align)
	Text5.Text = CStr(RasterEfxDlg.Text.WordWrap)
	Text6.Text = CStr(RasterEfxDlg.Text.ShadowXDepth)
	Text7.Text = CStr(RasterEfxDlg.Text.ShadowYDepth)
	Text8.Text = CStr(RasterEfxDlg.Text.EnableUseForegroundImage)
	Text9.Text = RasterEfxDlg.Text.Font.Name
	Text10.Text = CStr(RasterEfxDlg.Text.Font.Size)
	Shape1.FillColor = RasterEfxDlg.Text.Color
	Shape1.FillColor = RasterEfxDlg.Text.HiliteColor
	Shape1.FillColor = RasterEfxDlg.Text.ShadowColor
	RasterKrnDlg.FreeDlg
End Sub