Page 2 of 2

Re: Detect label and change it

Posted: Sunday 2nd October 2022 10:48am
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.

Re: Detect label and change it

Posted: Sunday 2nd October 2022 10:56am
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.

Re: Detect label and change it

Posted: Sunday 2nd October 2022 1:53pm
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 145 times
Tip: - To make an Archive to post on the Forum, in Gambas: -

Image

Re: Detect label and change it

Posted: Sunday 2nd October 2022 2:53pm
by gambafeliz
Thanks cogier, I'll do that next time. Greetings.

Re: Detect label and change it

Posted: Sunday 2nd October 2022 3:04pm
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

Re: Detect label and change it

Posted: Monday 3rd October 2022 12:19am
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.

Re: Detect label and change it

Posted: Monday 3rd October 2022 6:07am
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...