Results 1 to 4 of 4

Thread: [RESOLVED] Button Control Properties

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Location
    Botswana
    Posts
    107

    Resolved [RESOLVED] Button Control Properties

    hey everyone. in vb.net (express edition) im trying to change multiple button properties at the same time. if i want to change the button width, this works

    Code:
            For i = 1 To 42
                With Calendar.Panel1.Controls("Button" & i)
                    .width= 12
                End With
            Next
    but if i want to change the button border, this wont work:

    Code:
            For i = 1 To 42
                With Calendar.Panel1.Controls("Button" & i).FlatAppearance
                    .bordersize = 12
                End With
            Next
    whats the difference and how do i get it working?

    thanks
    jason
    I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Button Control Properties

    Is your button FlatStyle set to Flat? The default is Standard, in which case setting the FlatAppearance border has no effect.

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Button Control Properties

    you need to cast it as a button:

    vb Code:
    1. For i = 1 To 42
    2.      With directcast(Calendar.Panel1.Controls("Button" & i), Button).FlatAppearance
    3.          .bordersize = 12
    4.      End With
    5. Next

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Location
    Botswana
    Posts
    107

    Re: Button Control Properties

    thanks, that did it
    I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base

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