Detect label and change it

New to Gambas? Post your questions here. No question is too silly or too simple.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Detect label and change it

Post by cogier »

p.s. cogier posted while I was typing. It's a good simple solution but not robust.... If the form is redesigned at some point in time then the two arrays will not necessarily be correct any longer. Believe me, I know this from sad experience.
I am struggling with this comment. My solution contains HBoxes with the Labels and TextBoxes, as mentioned by Bruce Steers. Can you post some code that demonstrates your points, perhaps using my Form design.
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Detect label and change it

Post by gambafeliz »

Hello

Have a good Sunday, everyone.

Faced with so many good programmers, something simple has occurred to me. I hope they don't laugh and maybe you even like it.

Look at one more proposal, mine :)

Another thing, it is possible that it says something regarding the coordinate but a range can be made to correct it, only that I have not bothered much to show my code.

Greetings.
Attachments
validateText-0.0.1.tar.gz
(11.84 KiB) Downloaded 114 times
Last edited by gambafeliz on Sunday 2nd October 2022 2:52pm, edited 1 time in total.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Detect label and change it

Post by cogier »

I still think this solution is a lot easier and uses less code. This is your program modified.
validateText-0.1.tar.gz
(12.39 KiB) Downloaded 126 times
Tip: - To make an Archive to post on the Forum, in Gambas: -

Image
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Detect label and change it

Post by gambafeliz »

Thanks cogier, I'll do that next time. Greetings.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Detect label and change it

Post by gambafeliz »

One thing I want to point out.

Vuott, your code is not valid for my case since it is prepared, that is, you make your labels be linked with some TextBox through the index of the array.

And the same goes for cogier, you bind the labels with the TextBoxes.

If you look at my code that I have uploaded, the label and the TextBox are not known at all, neither by array nor by anything, I track them by their Y coordinate.

And in my example for this publication that is what happens to me, I have a form with label and textbox that do not have any link. And what is intended is to solve it like this.

Eye, I greatly appreciate your help, of course, but I wanted to point out the code at this point and of course with the utmost respect.

Thank you
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: Detect label and change it

Post by vuott »

In the initial message you did NOT mention coordinates. Saying "without associating it" means absolutely nothing or is otherwise unclear.
it is impossible to understand what you want, maybe you didn't realize it.
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Detect label and change it

Post by gambafeliz »

Hello my dear Vuott.

Everything is possible friend coming from me. But in this case I think that in the body of the publication I say it clearly. But otherwise I apologize. First of all your always good help and your person is for me much more important than discussing the body of the publication.

Best regards

Nota: I also think I remember that it also comes out in the conversation with ...Bruce...
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Post Reply