[Gambas-user] Looking for a little help with an app.

Stefano Palmeri rospolosco at ...152...
Mon May 11 17:42:27 CEST 2009


Il lunedì 11 maggio 2009 17:09:35 CelticBhoy ha scritto:
> Sorry I mean the valuebox containing the total. I dont want the user to be
> able to change the value apart from entering in valuebox 1, 2, & 3 in your
> example. The user should not be able to change valuebox4 directly.

It seems there a bug in the ValueBox control the let the user
edit the value even is the control is ReadOnly. For the
moment you could use a textbox control set as ReadOnly for the total.

The example changes this way (delete the ValueBox4 and add TextBox1)

PUBLIC SUB _new()

END

PUBLIC SUB Form_Open()
   
   TextBox1.Text = 0
   TextBox1.ReadOnly = TRUE
   TextBox1.Alignment = Align.Right
   
END

PUBLIC SUB SalesValues_Change()
   
   DIM iTotal AS Integer
   
   iTotal = 0   
   
   IF ValueBox1.value THEN iTotal += ValueBox1.value
   IF ValueBox2.Value THEN iTotal += ValueBox2.Value
   IF ValueBox3.Value THEN iTotal += ValueBox3.Value
   TextBox1.Text = iTotal

END




More information about the User mailing list