Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Getting controls from panel/tile
posted

http://help.infragistics.com/Help/Doc/WinForms/2012.1/CLR2.0/html/WinTilePanel_Adding_Multiple_Controls_to_a_Tile_in_WinTilePanel.html

Following the above example, we add a new tile

Dim utp1 As Infragistics.Win.Misc.UltraTilePanel     '//THE ULTRA-TILEPANEL PANEL

Dim tile1 As New Infragistics.Win.Misc.UltraTile()  '//THE ULTRA-TILE

Dim upTilesPanel As New UltraPanel                   '//THE ULTRA-PANEL 

utp1.Tiles.Add(tile1)                                       '//ADD TILE TO TILEPANEL

tile1.Control = upTilesPanel                              '//ADD PANEL TO TILE

then we add contols:

a textbox(s):

  Dim txt1 As New TextBox

txt1.name = "TXT1NAME"

txt1.Width = upTilesPanel.ClientArea.Width - 23
txt1.Anchor = AnchorStyles.Left Or AnchorStyles.Right
upTilesPanel.ClientArea.Controls.Add(txt1)                        '//ADD TEXTBOX TO PANEL

A datetimepicker..

 Dim dat1 As New DateTimePicker

dat1.name = "DAT1NAME"

dat1.Width = upTilesPanel.ClientArea.Width - 23
dat1.Anchor = AnchorStyles.Left Or AnchorStyles.Right
upTilesPanel.ClientArea.Controls.Add(dat1)

a button

Dim btn1 as new button

btn1.Width = upTilesPanel.ClientArea.Width - 23

btn1.Font = New Font("", 10, FontStyle.Bold)
upTilesPanel.ClientArea.Controls.Add(btn1)
AddHandler btn1.Click, AddressOf TileButtonClicked

..and so on

The problem, when the button is clicked, we want to get the txt in the textbox, and the value of the datetimepicker

For example sakes, lets just use MSGBOX()


Private Sub TileButtonClicked(sender As Object, e As EventArgs)

  MSGBOX (upt1.tiles(0).controls(0).ClientArea.Controls("DAT1NAME").text  ) '??ERR: 

MSGBOX (upt1.tiles(0).controls(0).ClientArea.Controls("TXT1NAME").text  ) '??ERR: 

  MSGBOX(   ????    )  '//HOW TO PRINT CONTROL (0).TEXT & CONTROL(1).VALUE

End Sub



Parents
No Data
Reply
  • 255
    Verified Answer
    posted

    Ive solved this by making the panel global.

       The panel cannot be disposed or it will give errors if you reuse the panel

    Dim upTilesPanel As New UltraPanel  

    It can be called as so

    Dim tempdtp As DateTimePicker = upTilesPanel.ClientArea.Controls("DAT1NAME")

    'from.Controls.ClientArea.Controls()
    MSGBOX( tempdtp.Value.tostring )
    ''GET SECOND DATETIME
    tempdtp = upTilesPanel.ClientArea.Controls("DAT2NAME")
    MSGBOX ( tempdtp.Value.tostring)

    Dim temptxt As TextBox = upTilesPanel.ClientArea.Controls("TXT1NAME")

    MSGBOX( temptxt.text )

Children