in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Resize controls added at runtime

Last post 11-23-2007 11:19 AM by pjreviejo. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-20-2007 1:48 PM

    Resize controls added at runtime

    I have a sizer created at runtime. I have added some columns an rows.

    I have added a control in one cell, but when the I move the splitter, the control just added doesn't resize automatically.

    It only happens when I use c1sizer.grid.clear and I insert rows and columns. If I have a sizer with rows and cols, the resize run properly

    Do I need code in the event SplitterMoved or not?

    And if the response is yes, How can i know which control added I need to resize depending on the band resized?

    My sample

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

    Dim t As New Button

    Siz.Controls.Add(t)

    t.Bounds = GetCellRectangle(Siz, 0, 1)

    End Sub

    Private Function GetCellRectangle(ByVal vSizer As C1Sizer, ByVal row As Integer, ByVal col As Integer) As Rectangle Return Rectangle.Intersect(vSizer.Grid.Rows(row).Bounds, vSizer.Grid.Columns(col).Bounds)

    End Function

  • 11-23-2007 11:19 AM In reply to

    Re: Resize controls added at runtime

    Solved. After execute the clear method I must to tell to de C1Sizer the Autosize property is Grid.

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.