• λ我爱Aspx >> Asp.Net >> 如何遍历窗体上的控件并按TYPE给它定具体风格
  • 如何遍历窗体上的控件并按TYPE给它定具体风格

  • :aspxer  Դ:csdn  :2007-7-6 2:38:00  ؼ:
  • 如何遍历窗体上的控件并按TYPE给它定具体风格

    google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";

    第2楼. 由 magicbacon 于 2007-6-7 9:22:23 发表

    Public Class Form1

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    For Each ctrl As Control In Me.Controls

    If TypeOf ctrl Is TextBox Then

    With CType(ctrl, TextBox)

    .BackColor = Color.Green

    .Width = 200

    End With

    ElseIf TypeOf ctrl Is Button Then

    With CType(ctrl, Button)

    .AutoSize = True

    End With

    End If

    Next

    End Sub

    End Class

    第3楼. 由 magicbacon 于 2007-6-7 9:23:32 发表

    以上是遍历窗体控件,改变TextBox和Button两种控件的设置。

    第4楼. 由 51Crack 于 2007-6-7 9:47:31 发表

    如果有容器控件(如GroupBox),要for中for

    第5楼. 由 magicbacon 于 2007-6-7 9:49:21 发表

    Ҷƪл˵?
  • һƪ最近几天在学STRUTS,有个超级菜的问题
    һƪstruts和hibernate简单问题