Похожие чаты

Before I start: I haven't worked on something like that so

please don't expect me to be able to give you information how to implement such a thing properly.
The answer:
I would try the following:
You have a page with a help button on it. If you click you create EventArgs containing the name of the page (nameof could be nice to use here to enable refactoring of strings).
Now you load the stuff which can be seen in your screenshots in the following way:
LoadHelp(EventArgs args);
In LoadHelp you create the buttons (visually).
Then you either load the default help page by say LoadDefaultPage();
or you call LoadPage(EventArgs args) with the args from above.
LoadPage now evaluates the args by the string you set within the onclick event in a way like:

// Notice that nameof could be again a good choice.
// Alternatively you could provide a static class
// or something containing constants like
// public static const string Login = "Login";
switch(args.PageName)
{
case("Login"):
// stuff
break;
case("Registrar"):
// stuff
break;
// more cases
default:
LoadDefaultPage();
break;
}

Now you don't have to "click" your buttons anymore but can process the event to a separate logic which handles not only your help-page buttons but the page buttons with the help button, too!

I hope this is understandable. Sorry, my english is not that good so I (maybe?) have to build strange sentences.

Again:
I never did this and I can't provide a "tutorial". I can notice though that your design looks smelly in case of maintainability and bug-awarness because of the chaining responsibility. In that special case it MAY work without problems but if you ever choose to redesign you could run into issues (IMHO)!

Maybe the other guys in this group can provide a much more solid solution for you.
In doubt consider asking your question again on stackoverflow.com.

2 ответов

9 просмотров

Please format the code you posted, by wrapping it in triple backticks. -> `

To be honest, it is confusing for me to comprehend this. I'll have to do a trial setup to try to understand how it all works. I understand a slight bit but I will try. Thanks

Похожие вопросы

Обсуждают сегодня

Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Мужики и девушки, привет) в Вelphi xe7 в настройках во вкладке "Editor Options" далее " Color" есть список: "Elements", открыв который мы можем настраивать отображение разных...
Kraszx
14
is that okay?
Samurai 🇯🇵
21
Добрый вечер. Есть вопрос, а может и предложение. Был у меня диалог в другой группе о делфи и я задался вопросом: "А нельзя ли в делфи цвет //коментария и {комментария} сде...
Kraszx
24
How about the project bro Likes the community not that active ?
🅿️abby_FX
19
Guys, Donald Trump or Kamala Harris? It does not matter for Bitcoin in the long run!! 2020 Election: After Joe Biden's victory in November 2020, Bitcoin steadily rose from...
Sabah Shabu
1
как быть с принтером? такой подход прокатит?
zamtmn
12
Всем привет! Подскажи, пожалуйста, как передать в TComboBox сразу значение и id записи. На Delphi я делал так: ComboBox1.Items.AddObject('Какое-то значение', Pointer(id запис...
Евгений
13
Мдя, прикол, боевая сборка запускается (именно под отладчиком) после F9 примерно полторы минуты (97 секунд если быть точным). Начал копать - проблема детектится сразу - зависа...
Александр (Rouse_) Багель
38
@brucezli Any info regarding ETA on updates?
Old Man Tom
10
Карта сайта