Hi there everyone.
I am working on a student attendance prog. When they come in, they see a picturebox with their name on it called Container1, and move it to a certain spot on the board, and it will sign them in.
The problem is, each picturebox has a label caption such as StudentNameLBL1, a background picture called studentimg1, and a small avatar called Avatar1.
In an old version, they just clicked on the label caption, because it was just their name, using this code.
But that would only let them move the new sign in box as long as they click on the label, is there a way that if they click anywhere on the picturebox, which is called Container1, it would be the same as clicking on the image inside the box called studentimg1, the avatar, called Avatar1, or the label caption called StudentNameLBL1??
Thanks!!!
I am working on a student attendance prog. When they come in, they see a picturebox with their name on it called Container1, and move it to a certain spot on the board, and it will sign them in.
The problem is, each picturebox has a label caption such as StudentNameLBL1, a background picture called studentimg1, and a small avatar called Avatar1.
In an old version, they just clicked on the label caption, because it was just their name, using this code.
VB Code:
Private Sub StudentNameLBL1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = vbLeftButton Then Xx = x yy = y Container1.MousePointer = vbSizeAll End If End Sub Private Sub StudentNameLBL1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = vbLeftButton Then With Container1 .Left = .Left - (Xx - x) .Top = .Top - (yy - y) End With End If End Sub Private Sub StudentNameLBL1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) With Container1 Container1.MousePointer = vbDefault If Val(StudentNum.Text) <= 19 Then If (.Top > 3000 And .Top < 6240) And (.Left > 3370 And .Left < 7200) Then If AttendanceV3.LanguageTXT.Text = "EN" Then Message2.Show Message2.StudentChosenTXT.Text = "1" StudentChosenTXT.Text = "1" StudentNameTXT.Text = StudentNameLBL1.Caption Call WhenStudentSignsInEN Container1.Visible = False End If If AttendanceV3.LanguageTXT.Text = "FR" Then MessageFR.Show MessageFR.StudentChosenTXT.Text = "1" StudentChosenTXT.Text = "1" StudentNameTXT.Text = StudentNameLBL1.Caption Call WhenStudentSignsInFR Container1.Visible = False End If End If End If If Val(StudentNum.Text) >= 20 Then If (.Top > 3000 And .Top < 6240) And (.Left > 4560 And .Left < 8280) Then If AttendanceV3.LanguageTXT.Text = "EN" Then Message2.Show Message2.StudentChosenTXT.Text = "1" StudentChosenTXT.Text = "1" StudentNameTXT.Text = StudentNameLBL1.Caption Call WhenStudentSignsInEN Container1.Visible = False End If If AttendanceV3.LanguageTXT.Text = "FR" Then MessageFR.Show MessageFR.StudentChosenTXT.Text = "1" StudentChosenTXT.Text = "1" StudentNameTXT.Text = StudentNameLBL1.Caption Call WhenStudentSignsInFR Container1.Visible = False End If End If End If End With End Sub
But that would only let them move the new sign in box as long as they click on the label, is there a way that if they click anywhere on the picturebox, which is called Container1, it would be the same as clicking on the image inside the box called studentimg1, the avatar, called Avatar1, or the label caption called StudentNameLBL1??
Thanks!!!