如何在循环中更改按钮no ...是否可能 [英] how do i change button no in loop... is it possible

查看:79
本文介绍了如何在循环中更改按钮no ...是否可能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim i As Integer = 1
        Dim statechck As String = "occupy"
        Dim state As String







i希望在表单加载时使用循环更改按钮中的图像






i wish to change the image in the buttons using loop at form load

While i <= 56
            Dim Str As String = "Select Status from Status where SeatNo = '" + i + "'"
            Dim reader As OleDbDataReader = cmd.ExecuteReader()

            While reader.Read()
                state = reader.GetValue(0).ToString()

                If state = statechck Then
                button[i].image= My.Resources.ResourceManager.GetObject("greenseat"))'gives error

                End If
                i = i + 1

            End While

推荐答案

尝试此处描述的方法: http://stackoverflow.com/questions/12065568/load-image-from-my-resources-to-a-picturebox-vb -net [ ^ ]
Try method described here: http://stackoverflow.com/questions/12065568/load-image-from-my-resources-to-a-picturebox-vb-net[^]


这篇关于如何在循环中更改按钮no ...是否可能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆