Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > How to determine item is click in VB.net

Answered How to determine item is click in VB.net

Feed from this thread
  • YING JANG LIN avatar

    Posted on Apr 4, 2010 (permalink)

    Hi,

    below is my code is add item to carousel

            RadCarousel1.Items.Add(ButtonBox1)
            RadCarousel1.Items.Add(ButtonBox2)
            RadCarousel1.Items.Add(ButtonBox3)
            RadCarousel1.Items.Add(ButtonBox4)

    Then, my question is

    1,How to catch which above button is click in below  subroutin ,

    Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged
                

        End Sub

    2, mouse over item can change mouse icon to hand that item move to path of specific position whcih predefine.
     
    Hope you can me.

    Thanks

    Reply

  • Peter Peter admin's avatar

    Posted on Apr 7, 2010 (permalink)

    Hi YING JANG LIN,
     
    You can get the selected button using the Carousel's SelectedItem in RadCarousel1_SelectedIndexChanged:
     
    me.radCarousel1.SelectedItem

    About the second question you can change the mouse cursor using each Carousel item button's events MouseHover and MouseLeave. Refer to the code below:
     
    AddHandler buttonBox1.MouseHover, AddressOf imageItem_MouseHover                AddHandler buttonBox1.MouseLeave, AddressOf imageItem_MouseLeave
     
    Private Sub imageItem_MouseLeave(ByVal sender As Object, ByVal e As EventArgs)
    Cursor = Cursors.Default       
    End Sub
    Private Sub imageItem_MouseHover(ByVal sender As Object, ByVal e As EventArgs)          
     Cursor = Cursors.Hand       
    End Sub
     
    but you cannot move an item to the specific positions with Drag&Drop, because coordinates for items are evaluated only from RadCarouselCalculator. Please, excuse us for the inconvenience.


    Sincerely yours,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • YING JANG LIN avatar

    Posted on Apr 7, 2010 (permalink)

    Hi,Peter

    Thank your resolution and help.

    for question 1

    Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged

            when mouse click at button1
     

            MsgBox(Me.RadCarousel1.SelectedItem)    <=== may be show <button1.text> ,but show <Telerik.WinControls.UI.RadButtonElement

           click at button2

           have same result
     
           MsgBox(Me.RadCarousel1.SelectedItem)    <=== may be show <button2.text> ,but show <Telerik.WinControls.UI.RadButtonElement

    End Sub


    Hope can help me
    Thanks

    Reply

  • Peter Peter admin's avatar

    Posted on Apr 8, 2010 (permalink)

    Hi YING JANG LIN,

    Thanks for the provided information.
     
    You should cast the SelectedItem to RadButtonElement and show the Text property of the RadButtonElement:
     
    Dim selectedButton as RadButtonElement
    selectedButton  = CType(radCarousel.SelectedItem, RadButtonElement)
    MessageBox.Show( selectedButton.Text )
    Hope this helps.

    Regards,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • YING JANG LIN avatar

    Posted on Apr 8, 2010 (permalink)

    Hi,Peter

    thanks your help.

    Below is exact code worked for this question and shared to other.

    Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged
            Dim selectedButton As RadButtonElement
            selectedButton = CType(Me.RadCarousel1.SelectedItem, RadButtonElement)
            MessageBox.Show(selectedButton.Text)
    End Sub

    1,another question is code add to Sub RadCarousel1_SelectedItemChanged cann't work That Hope you can tell me what?
    2,When Clicked button_next also fire RadCarousel1_SelectedIndexChanged,you can see hardcopy screen at attach file?
    3,I hope program run like Telerik run demo Integration section function?

    Thanks Peter

    Reply

  • Peter Peter admin's avatar

    Posted on Apr 13, 2010 (permalink)

    Hello Ying,

    The reason that SelectedItemChanged is not working as SelectedIndexChanged is virtualization - this event also fires with non virtualized items, so you can handle SelectedIndexChanged instead of SelectedItemChanged

    I cannot find any attached files in your ticket? Can you clarify what do you mean with "run like Telerik run demo Integration section function?" - we do not have any carousel examples in integration section in our example application.

    Regards,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • YING JANG LIN avatar

    Posted on Apr 13, 2010 (permalink)

    Hi,Peter

    I hope get hardcopy of attached file of sample code in Vb.net,
    Those samples are satisifiable demand for me.


    Thanks

    Attached files

    Reply

  • Answer Vassil Petev Vassil Petev admin's avatar

    Posted on Apr 16, 2010 (permalink)

    Hi YING JANG LIN,

    This carousel is a custom implementation for our demos only - this implementation is not supported. Please, use RadCarousel instead.


    All the best,
    Vassil
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • YING JANG LIN avatar

    Posted on Apr 16, 2010 (permalink)

    Hi,Vassil

    Thanks

    YC

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Carousel > How to determine item is click in VB.net
Related resources for "How to determine item is click in VB.net"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]