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 8297035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:15:10+00:00 2026-06-08T15:15:10+00:00

I am having problems coding some of my buttons. This is what I’ve got

  • 0

I am having problems coding some of my buttons. This is what I’ve got so far:

Public Class Form1

Dim Button(12) As Button
Dim X As Integer

Private Sub EventName()
    Dim message, title, defaultValue As String
    Dim myValue As Object
    If Label4.Text = "Admin" Then
        ' Set prompt.
        Message = "Enter Product Name"
        ' Set title.
        title = "Product Name"
        defaultValue = ""   ' Set default value.

        'Display message, title, and default value.
        myValue = InputBox(Message, title, defaultValue)

        Button(X).Text = myValue
    End If
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button9.Click, Button8.Click, Button7.Click, Button6.Click, Button5.Click, Button4.Click, Button3.Click, Button2.Click, Button12.Click, Button11.Click, Button10.Click
    'Dim message, title, defaultValue As String
    'Dim myValue As Object
    For Me.X = 1 To 10

        >>>>>    <<<<<<<

    Next
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Button(1) = Button1
    Button(2) = Button2
    Button(3) = Button3
    Button(4) = Button4
    Button(5) = Button5
    Button(6) = Button6
    Button(7) = Button7
    Button(8) = Button8
    Button(9) = Button9
    Button(10) = Button10
    Button(11) = Button11
    Button(12) = Button12
End Sub

What I’m trying to do, is if I click button 7, an input box comes up for the user to input the button’s name. No matter what I have tried between the >>>>> <<<<<, I can’t seem to get it right.

  • 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-06-08T15:15:11+00:00Added an answer on June 8, 2026 at 3:15 pm

    It sounds like you just want a person to click on a button and change the text of that button?

    If that is correct, something like this would work in your click method:

    With DirectCast(sender, Button)
      .Text = InputBox("Button Name", "Button Name", .Text)
    End With
    

    If every button needs that same input, then try something like this:

    Dim value As String = InputBox("Button Name", "Button Name")
    For Each btn As Button In Buttons
      If btn IsNot Nothing Then
        btn.Text = value
      End If
    Next
    

    You should strongly consider moving away from using that Buttons array. If you need to hold a reference of those buttons in a list, use a List(of Button) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having problems with a method in a class file: public static function getPageLeft($pid)
Im coding a social web application and Im having some problems. I will ask
Hi there I'm having some problems coding an animation for a UIView in my
I am having some REAL big problems coding SVG XML and having it being
I’m having some problems with John Guenin's x_sendfile ( http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ ). When coding the
I am coding this layout as a wordpress theme and having a slight problem
Im having problems with displaying ONLY some elements ONLY on print page. For example
Okay I am having some problems with being able to change bitmaps when a
I'm having some problems with implementing javascript controls in my asp.net page. I would
I am doing some coding for my class and I think I am on

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.