Forum > Beginners

BINGO application.

(1/2) > >>

seghele0:
The BINGO program is almost finished.
Have a problem with the EXIT button when the form is maximized.
The EXIT button keeps moving to the left, the other objects remain in place.
Does anyone have a solution please?
 ;)

dseligo:
You have discrepancy between Unit1.pas and Unit1.lfm (code and form).
In your Unit1.pas you don't have declaration for PanelBtnEXIT, so add it, ie. in line 27:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type  { TForm1 }  TForm1 = class(TForm)    BtnEXIT: TButton;    BtnGenerate: TButton;    BtnRestart: TSpeedButton;    LabelCLOCK: TLabel;    PanelTOPgrid: TPanel;    PanelLEFTgrid: TPanel;    PanelTIME: TPanel;    PanelBtnEXIResetGameT: TPanel;    PanelBtnRestart: TPanel;    PanelBtnNEW: TPanel;    PanelNUMBER: TPanel;    PanelStringGrid: TPanel;    PanelButtons: TPanel;    PanelBtnEXIT: TPanel; // <-- add this line...
Then change line 133 from BtnExit.SetBounds to:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  PanelBtnEXIT.SetBounds // <-- change this line   (PanelBtnNew.Left + PanelBtnNew.Width + Spacing,   (PanelButtons.Height - ControlHeight) div 2, BtnWidth + 50, ControlHeight -20);
I didn't check if you are missing some other declarations from form. Normally, form and source are synchronized.

P.S.: added explanation in code and comment at the end.

seghele0:
Thank you for the fast support with the correct code.
It works now.
I still have a lot to learn.
Fortunately, I can count on real support on this forum.
(Still working on the program.)
 :)

seghele0:
In attachment I leave the finished version of my BINGO application to all Pascal-Lazarus sympathizers.
Thanks for the great help from this forum and that of NL-Delphi.
Enjoy the program(FREE).
 ;)

Thaddy:
I will send you my code too, but somehow I forgot to do that. Sorry. I will leave it up to you to decide what's best.

Navigation

[0] Message Index

[#] Next page

Go to full version