我想要一个停车场预订系统,我把picbox让用户点击,我的问题是如何使用picbox连接到SQL 2014 [英] I want to a car park booking system, and I put picbox to let user click, my questions is how to use picbox to connect to SQL 2014
问题描述
我想要一个停车场预订系统,我把picbox让用户点击,我的问题是如何使用picbox连接到sql 2014,我的意思是我需要知道用户点击了哪个picbox,它会自动记录到sql 2014.
我尝试过:
私有子PictureBox10_Click(发件人为对象,e为EventArgs)
如果CType(发件人,PictureBox).Image可用,则说明
CType(发件人,PictureBox).Image = provisionalIcon
ElseIf CType(发件人,PictureBox).Image是provisionalIcon然后
CType(发件人,PictureBox).Image = availableIcon
结束如果
结束Sub
i want to a car park booking system, and i put picbox to let user click, my questions is how to use picbox to connect to sql 2014, i means i need to know which picbox the user have clicked, and it will auto record to sql 2014.
What I have tried:
Private Sub PictureBox10_Click(sender As Object, e As EventArgs)
If CType(sender, PictureBox).Image Is availableIcon Then
CType(sender, PictureBox).Image = provisionalIcon
ElseIf CType(sender, PictureBox).Image Is provisionalIcon Then
CType(sender, PictureBox).Image = availableIcon
End If
End Sub
推荐答案
使用sender
参数 - 它会告诉你单击PictureBox的实例,如果你有多个图片框都由同一个事件处理程序处理。
如果你有每个都由一个单独的方法处理,如代码中的方法名称所示,那么你已经知道点击了哪个盒子,因为它将转到一个特定的方法!
至于您的SQL问题,如果您需要帮助,则需要提供更多信息!
Use thesender
parameter - it tells you the instance of the PictureBox that was clicked, if you have a number of picture boxes all being handled by the same event handler.
If you have each one being handled by a separate method as the method name in your code implies, then you already know which box was clicked, because it will go to a specific method!
As for your SQL problem, you will need to provide a whole load more info if you want help with that!
这篇关于我想要一个停车场预订系统,我把picbox让用户点击,我的问题是如何使用picbox连接到SQL 2014的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!