Here's the code for my control:
Can anyone tell me why nothing is displayed on the contol? I've been trying for ages but can't get it to work!
Thanks,
Pete
Code:
Option Strict On
Option Explicit On
Public Class ucReel
Inherits System.Windows.Forms.UserControl
#Region " Windows Form Designer generated code
Private p_ReelImagePath As String = "E:\Reel.BMP"
Private p_TotalImages As Int32 = 9
Private p_ImageHeight As Int32 = 64
Private p_ImageWidth As Int32 = 64
Private p_ImagesInView As Int32 = 5
Private p_StepDistance As Int32 = 4
Private p_DelayBetweenSteps As Int32 = 1
Private p_StepNo As Int32 = 0
Private p_StepsPerCycle As Int32 = p_ImageHeight \ p_StepDistance
Private p_CycleNo As Int32 = 0
Dim rctfDestination As RectangleF = New RectangleF(0, 0, p_ImageWidth, p_ImageHeight * (p_ImagesInView - 1))
Dim rctfSource As RectangleF
Dim bmpReel As New Bitmap(p_ReelImagePath)
Dim grpcSurface As Graphics
Private Sub ucReel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
grpcSurface = CreateGraphics()
With rctfSource
.X = 0
.Y = 0
.Width = rctfDestination.Width
.Height = .Height
End With
grpcSurface.DrawImage(bmpReel, rctfDestination, rctfSource, GraphicsUnit.Pixel)
End Sub
End Class
Can anyone tell me why nothing is displayed on the contol? I've been trying for ages but can't get it to work!
Thanks,
Pete