Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6818861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:13:48+00:00 2026-05-26T21:13:48+00:00

I have loop to create a column of button and now i wish to

  • 0

I have loop to create a column of button and now i wish to implemented the eventhandler into all the buttons but is not working.

The iteration to create a column of button

 For e As Integer = 0 To 19
                btnFriday(e) = New Button()
                btnFriday(e).Height = 23
                btnFriday(e).Width = 150
                btnFriday(e).SetValue(Grid.ColumnProperty, 9)
                btnFriday(e).SetValue(Grid.RowProperty, e + 1)
                btnFriday(e).Click +=  New RoutedEventHandler(AddressOf btnBookSlot_Click)
                LayoutRoot.Children.Add(btnFriday(e))
    Next

I wish to do like when 1 of the btnFriday is clicked then perform the below event which is open a childwindow called as Bookslot

Private Sub btnBookSlot_Click(sender As Object, e As RoutedEventArgs)
    Dim btn As Button = DirectCast(sender, Button)
    Dim bookSlot As New BookSlot()
    bookSlot.show()

End Sub

And i receive error like

Public Event Click(sender As Object, e As
System.Windows.RoutedEventArgs)’ is an event, and cannot be called
directly. Use a ‘RaiseEvent’ statement to raise an event

Most of the solutions were built using C# with silverlight and they seem to be working great. While i having problem by using VB.NET with silverlight Any idea ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:13:48+00:00Added an answer on May 26, 2026 at 9:13 pm

    I believe all you need to change is:

     btnFriday(e).Click +=  New RoutedEventHandler(AddressOf btnBookSlot_Click)
    

    To:

      AddHandler btnFriday(e).Click, AddressOf btnBookSlot_Click
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Similar to my last question, but I ran into problem lets say I have
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I have a for loop that creates multiple UIImageViews that I add to self.view
I have a recordset loop that creates a table, and every 9 items it
I have created some python code which creates an object in a loop, and
I have loop designed to validate the user input on a question, it was
I have a loop that reads each line in a file using getline() :
I have a loop on page to update an access database that takes 15-20
I have a loop for(aI = antiviral_data.begin(); aI != antiviral_data.end();) { for(vI = viral_data.begin();
I have a loop that finds duplicate lines in a .ini file. I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.