aaronk Well-Known Member Licensed User Longtime User Aug 26, 2012 #1 Hello, I am adding a button to a page using the following code: Code: Copy close_button.initialize(500) Activity.AddView(close_button,0,(100%y - 45dip),(100%x),45dip) close_button.Text = "Click to close" I then are trying to make it so when you click it, display a message box. I am using the following code but it don't seem to be working. Code: Copy Sub close_button_Click Msgbox("test message","title") End Sub under 'Sub Globals' I have put: Code: Copy Dim close_button As Button when I tap on the button on my page it don't seem to do anything.. Anyone know where I went wrong?
Hello, I am adding a button to a page using the following code: Code: Copy close_button.initialize(500) Activity.AddView(close_button,0,(100%y - 45dip),(100%x),45dip) close_button.Text = "Click to close" I then are trying to make it so when you click it, display a message box. I am using the following code but it don't seem to be working. Code: Copy Sub close_button_Click Msgbox("test message","title") End Sub under 'Sub Globals' I have put: Code: Copy Dim close_button As Button when I tap on the button on my page it don't seem to do anything.. Anyone know where I went wrong?
I Inman Well-Known Member Licensed User Longtime User Aug 26, 2012 #2 Why are you initialising the button as close_button.initialize(500)? Within the brackets it should be the name you are planning to use to detect the events for the button. For example it could be close_button.initialize("close_button") and then use the same name to detect the clickevent Sub close_button_Click. Upvote 0
Why are you initialising the button as close_button.initialize(500)? Within the brackets it should be the name you are planning to use to detect the events for the button. For example it could be close_button.initialize("close_button") and then use the same name to detect the clickevent Sub close_button_Click.
aaronk Well-Known Member Licensed User Longtime User Aug 26, 2012 #3 Hello, Oh, I was wondering what the (500) meant. I was using the code from another project. Thanks for clearing it up for me. Upvote 0
Hello, Oh, I was wondering what the (500) meant. I was using the code from another project. Thanks for clearing it up for me.