refreshing the text of a label

skywalker34

Member
Licensed User
Longtime User
I have do do something like that

'get le value from pressed button
value = btn.Tag

label_mess.Text = label_mess.Text & value

The problem is that th label don't print on screen, but value is stored

I try "label_mess.Invalidate" without more success even with some doevents loop

any idea ?
 

skywalker34

Member
Licensed User
Longtime User
label_mess.Text = label_mess.Text & value should work.
How do you define btn.Tag ?
What variable type is value ?
You should post more code so we could find out what is wrong.

Best regards.

Here is a small part of my coding :

Sub Buttons_Click
Dim btn As Button
Dim Unit As String
Dim value As String
btn = Sender
Log("Button " & btn.Tag & " clicked") 'write the line to LogCat

If Current_Page=0 Then ' number's page
If btn.Tag="11" Then
value = "."
Else
value = btn.Tag
End If

Label_qty.Text = Label_qty.Text & value
Log("Label_qty=" & Label_qty.text)
For i = 0 To 1
Label_qty.Invalidate
DoEvents
Next


The logcat show correct result, but nothing on screen ????
Label_qty.text is set to "" in designer
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
Can you post your project as a zip file so we could test it (IDE menu Files / Export As Zip).
It should work !
So the problem is somewhere else.

Best regards.

Sorry but the project is confidential and too environment dependent and in connection to our web server.

Anyways than for the help , I was thinking this should work too, but being new on basic4A I need confirmation about this.

Rgds

P.S. this was working with EditText but we don't want the user to fill the information by other way than our button and there where a flashing carret in the field
Maybe you can suggest something to remove this carret and/or lock virtual keyboard ?
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Can you make a small project that shows the problem?
How are the Buttons defined ?
You can have a look at the ScecondProgram shiped with the Beginner's Guide there is a custom keyboard with buttons filling a Label exactly what you are looking for.

Best regards.
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
Thanks You so much Klaus for the time you spend to help me

I finally found the problem :sign0137: : the text color was black and my screen too :BangHead:

Sometime it is better to check basic things than spend time to explore the jungle to find his own foot !
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…