How do I add html to a VB form?

  • Thread starter Thread starter C.K
  • Start date Start date
C

C.K

Hi all,

Is it possible to use html to design my form. What I want to do
is to make a calendar program, which will receive a picture
image and a month, and the form must display the image on
the top half of an A4 and a calander grid on the bottom half.
I thought html could be useful to do this, is it possible?
 
CK,

You have to set yourself the pictures in an imagelist and use that on the
buttons.

It is a sample I once made.

I hope this helps?

Cor
\\\Needs only a form and nothing more.
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim start As Integer = 4
Dim top As Integer = 25
Dim i As Integer
Dim nowdate As DateTime = DateTime.Now
Dim mybutton(System.DateTime.DaysInMonth _
(nowdate.Year, nowdate.Month)) As Button
For i = 0 To System.DateTime.DaysInMonth _
(nowdate.Year, nowdate.Month) - 1
mybutton(i) = New Button
mybutton(i).TextAlign = ContentAlignment.MiddleCenter
mybutton(i).Width = 40
mybutton(i).Height = 20
mybutton(i).FlatStyle = FlatStyle.Flat
mybutton(i).BackColor = Drawing.Color.AntiqueWhite
mybutton(i).Location = New System.Drawing.Point(start, top)
mybutton(i).Text = (i + 1).ToString
mybutton(i).Cursor = Cursors.Hand
Me.Controls.Add(mybutton(i))
AddHandler mybutton(i).Click, AddressOf mybutton_Click
AddHandler mybutton(i).MouseHover, AddressOf mybutton_Hoover
AddHandler mybutton(i).MouseLeave, AddressOf mybutton_Leave
start = start + 40
If (i + 1) Mod 5 = 0 Then
top = top + 20
start = 4
End If
Next
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
MessageBox.Show("The day is: " & thisbutton.Text)
End Sub
Private Sub mybutton_Hoover _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
thisbutton.BackColor = Drawing.Color.AliceBlue
End Sub
Private Sub mybutton_Leave _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thisbutton As Button = DirectCast(sender, Button)
thisbutton.BackColor = Drawing.Color.AntiqueWhite
End Sub
///
 
Hi Cor,

Thanks for your code. Are you using buttons to create the
calendar grid ? This is a good idea - didn't think of it.
I want to just tell you more about the design, see what
you think. Firstly, the image will be on the top half of
the A4, i.e. not underneath the calendar, and I might
add that the entire form will only be used for printing
off a calendar month, i.e. not for on screen display.
Let me know if any more ideas spring to mind...

tfn
C.K.
 
I am now thinking there will be a problem with the button array
approach, how can I print it, I believe we cannot print the
VB form, or can we ?

Regarding 3rd party controls, this will be a last resort approach.

C.K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top