AddEvent for checkbox

TWELVE

Active Member
Licensed User
Hi @all,

i read the documentation and did a search on the forum, but no luck.

I would like to raise an event once a checkbox gets changed ( checked/unchecked).

I use this kind of statements for all my events:

AddEvent ("button2", "Click", "my sub")

AddEvent ("checkbox8", "<event>", "my sub")

This works for menus and buttons so far, but i could not find, what the name of the event is, that is being raised by checking/unchecking a checkbox.I tried several values ( "checked" etc.) but none worked.

I'm sorry, but i have to say(again), that the Basic4PPC documentation is still very poor, a lot of questions in the forum here would not be necessary with a better documentation...


So what are the valid events for a checkbox..?


regards,

TWELVE
 

Pachuquin

Member
Licensed User
Longtime User
I use this kind of statements for all my events:

AddEvent ("button2", "Click", "my sub")

AddEvent ("checkbox8", "<event>", "my sub")

I have tried:

AddEvent ("checkbox8", Click, "mysub")

and it works.

I'm sorry, but i have to say(again), that the Basic4PPC documentation is still very poor, a lot of questions in the forum here would not be necessary with a better documentation...

From the Basic4ppc help:

Syntax: AddEvent (Control Name, Event Name, Sub Name)
The following controls support AddEvent:
Button, CheckBox, ComboBox, Form, Image, MenuItems, Panel, RadioBtn, Table, TextBox and Timer.
Note: As in this example, Event Name is not quoted and can't be a variable.
Example:
AddButton ("Form1", "Button1", 20,20,60,60,"Click Me")
AddEvent ("Button1", Click, "MySub")
AddEvent ("Form1",MouseDown, "DoSomething")
 
Last edited:

TWELVE

Active Member
Licensed User
Hi Pachuquin,

thanks for your reply.I got it to work now.

1.

Note: As in this example, Event Name is not quoted and can't be a variable.

This does not seem to matter, i use this with quotes since a long time.I works with and without quotes.I took the quotes from a code example and then never thought about again.

2. The control itself is called "CheckBox8" in the Designer.As for the AddEvent, it does not matter if "CheckBox8" or "checkbox8" is used.Even something like "CHecKBox8" is gonna work.

3. I use a centralized event manager by pointing all added events to this one sub.In the sub, a select..case construction is used to select what an event is gonna do.In opposition to the AddEvent the control's name sent to the action sub is always in lower case !

==> Hence when i tried to catch it with Case "CheckBox8" : my sub it got never triggered, because the control's name that is being sent is "checkbox8".
After correcting the case to all lower case, it is working now as expected.


This is very confusing und inconsistent...

Nevertheless i thank you because you pointed me in the right direction...


regards,

TWELVE
 

RacingDog

Active Member
Licensed User
What are you talking about? The documentation clearly lists the available events. For checkbox the help info says.....

CheckBox allows the user to choose from multiple options.
Unlike RadioBtn where only one can be checked, each CheckBox can be checked.
Properties and Methods:
BringToFront
Color
Checked
Dispose
Enabled
Focus
FontColor
FontSize
Height
Left
Name
Refresh
Text
Top
Visible
Width
Events:
Click

WHAT IS THAT ^. It says Events: Click. Why isn't that crystal clear?
 

tsdt

Active Member
Licensed User
Regarding fmodce.dll

Hi,

I am currently using FMODCE.dll verion 3.75 (has two types). I am using the non-arm version because my platform is non-arm version.

However, I noticed that the FMODCE.dll is giving me a lot of problems.
For example, error mentioning some kinds of clashes with the system. The other problem I find related to B4PPC - After I finished running the FMODPLAY, I notice that calling the other dll functions will return error. I replace the FMODPLAY with Sound(), and the problem no longer exists. I truly believe that this is related to FMODCE.dll.

Thanks.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…