Rename custom buttons, name and text

Claude Larocque 666 Reputation points
2023-11-15T10:39:56.3366667+00:00

Hi, I attach a PDF file with the code that explains what I want to achieve, thanks!

On the invoicing form, I have 24 hidden buttons that could be activated by other forms, the name of that form is “FrmBilling”, these buttons are named BtnCustom1 to BtnCustom24, they can be setup using 2 forms, the first one is to show the location of these 24 buttons on the billing form (FrmCustomButtons) and the second is to rename the buttons and change the text on these 24 buttons and assign a product or functions to them (FrmCustomButtonsSetup).

Claude from Quebec, CanadaChange buttons names and add functions.pdf

Developer technologies VB
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2023-11-16T07:13:37.3+00:00

    Hi @Claude Larocque ,

    You can pass the Button directly as a parameter to FrmCustomButtonsSetup, so that you can modify the properties of the Button in FrmCustomButtonsSetup.

    Public Class Form1
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Dim fm2 As New Form2(sender)
            fm2.Show()
        End Sub
    End Class
    
    Public Class Form2
        Dim BT As Button
    
        Public Sub New(Button As Button)
            BT = Button
            InitializeComponent()
        End Sub
    
        Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
            BT.Text = TextBox1.Text
        End Sub
    End Class
    

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.