Results 1 to 5 of 5

Thread: Textbox lock property (Resolved)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182

    Exclamation Textbox lock property (Resolved)

    How do I achieve this

    For Each CntTxt In pnlMain.Controls
      If TypeOf CntTxt Is TextBox Then
        CntTxt.ReadOnly = True
        CntTxt.Cursor = Cursors.Arrow
        CntTxt.ForeColor = ForeColor.Blue
      End If
    Next

    Bolded line doesn't work.
    Last edited by vsusi; Oct 28th, 2003 at 12:06 PM.

  2. #2
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    how about setting the enabled property to false

  3. #3
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    at the risk of sounding funny, i'm fairly sure the " ReadOnly " property is " ReadOnly " and can only be set up at design time not at runtime.
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182
    Enabled makes everything dull.

    Locked property is not available.

    I am able to set textbox readonly property even in runtime by using its name. But how do it with control collection like above.

    .Net sucks for me.
    .NET doesn't look like a RAD tool anymore.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    MD
    Posts
    182

    Made it to work (Somehow)

    Dim txtColl As New Collection

    txtColl.Add(txtField1)
    txtColl.Add(txtField2)

    For i = 1 To txtColl.Count
      txtColl.Item(i).Readonly = True
      txtColl.Item(i).Cursor = Cursors.Arrow
      txtColl.Item(i).ForeColor = ForeColor.Blue
    Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width