You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

travisone

Beginner

  • "travisone" started this thread

Posts: 3

Date of registration: Nov 1st 2012

  • Send private message

1

Thursday, November 1st 2012, 3:29pm

Option Button unselected works on vb6 .. help now in abaco?

Hello my program works perfect on vb6
then when i use jabaco unselected option doesnt work ( i have a group of arrays option buttons)

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Dim FoundIndex1 As Integer
Dim ToggleVal As Boolean

Private Sub Form_Load()
 FoundIndex1 = -1
End sub


Private Sub Option1_GotFocus(Index As Integer)
 FoundIndex1 = Index
End Sub


Private Sub Option1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
 ToggleVal = Option1(Index).Value
End Sub


Private Sub Option1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
 With Option1(Index)
 .Value = .Value Xor ToggleVal 'Toggle the state of the option
 If .Value Then 'If it is selected Then
 FoundIndex1 = Index ' Save the index
 Else 'Else (not selected)
 FoundIndex1 = -1 ' Flag as not selected

End If
 End With
End Sub

This post has been edited 2 times, last edit by "travisone" (Nov 1st 2012, 4:20pm)


Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

2

Thursday, November 1st 2012, 4:44pm

Hey there,

I am Not sure I understand!
You are trying To unselect every OptionBox of that group?

You did Not post the code For UpdateLabels.
So I don't know how you are trying to do that!

I think when after the initial start of the programm you have made a selection, exactly one button Is selected from Then On!

The underlying Java radio-button-group concept does Not allow a Single JRadioButton to be used to 'turn it on and off again' :(

Use the CheckBox Instead!


Dani

travisone

Beginner

  • "travisone" started this thread

Posts: 3

Date of registration: Nov 1st 2012

  • Send private message

3

Thursday, November 1st 2012, 9:37pm

Sorry about that, you can use just the code without the updatelabels. in vb works but in jabaco doesnt do the job

and yes i have 3 option button (array) in a frame
like this
option1(0)
option1(1)
option1(2)

for example:
my code in visual basic when u click on one option1(0) the others are false of course, and if i click again on option1(0) this option come false, and of course the others keep on false state.

i dont use checkbox because is easy when u have 3 frames and 3 option arrays like this option1, option2,option3
then some labels updates later when clicking..

If is possible to make it work on jabaco please i really appreciate it!!




Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
Dim FoundIndex1 As IntegerDim ToggleVal As Boolean
Private Sub Form_Load()FoundIndex1 = -1End Sub

Private Sub Option1_GotFocus(Index As Integer)FoundIndex1 = Index
End Sub

Private Sub Option1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)ToggleVal = Option1(Index).ValueEnd Sub

Private Sub Option1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)With Option1(Index).Value = .Value Xor ToggleVal 'Toggle the state of the optionIf .Value Then 'If it is selected ThenFoundIndex1 = Index ' Save the indexElse 'Else (not selected)FoundIndex1 = -1 ' Flag as not selected
End IfEnd With
End Sub

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

4

Monday, November 12th 2012, 10:57am

Hey there,

try adding one more but invisible button To the button group.
When you want To "deselect", Select the invisible one.

Jabaco Source

1
OptionBox1.Visible = False


If you find another solution ... please share!

Dani

IAO

Beginner

  • "IAO" is male

Posts: 38

Date of registration: May 25th 2013

Location: Venezuela

Occupation: Electronic

  • Send private message

5

Saturday, June 1st 2013, 9:01pm

Hi...

A little late, but it worked well...

Source code

1
2
Command1.Caption = "Disable"
Command1.Enabled = False


Do not let this project die. :)

Rate this thread
WoltLab Burning Board