Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Photo album
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cor Ligthert  
View profile  
 More options Oct 21 2004, 7:13 am
Newsgroups: microsoft.public.dotnet.languages.vb
From: "Cor Ligthert" <notmyfirstn...@planet.nl>
Date: Thu, 21 Oct 2004 13:13:38 +0200
Local: Thurs, Oct 21 2004 7:13 am
Subject: Re: Photo album
Vexander,

Yes of course, you have to build the pictureboxes than dynamicly and use the
image.fromfile to load them. I have no sample for that, however I think that
your first question is how to build it dynamicly. This is a sample with
buttons, however can be of course as well with pictureboxes.

I hope it helps?

Cor
\\\
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).MouseEnter, AddressOf mybutton_Enter
            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_Enter _
      (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
///


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google