I am displaying various text in a statictext box. I don't want to use scroll bars or have it user-adjustable in any way.
Sometimes the text is too much to fit into the statictext box. When this happens I would like to shrink the fontsize.
I have no trouble adjusting the fontsize (I'm a...
I'm creating an application meant to be freely available to other University departments. I'm not interested in copy-protecting it per se, but I want to make sure that the attribution and credit are maintained. Right now, the splash screen, which is a .bmp, has all the credit information...
I position many of my modal forms relative to the main form by setting their top and left properties relative to the main form.
modalform.left := mainform.left + 100;
modalform.top := mainform.top + 100;
That way, my modal forms are always in the same position relative to the main form...
I'm trying to show an Mpeg in an TEdit control on my form.
My basic code is;
procedure TForm1.Button1Click(Sender: TObject);
begin
MediaPlayer1.FileName := movie.mpeg;
MediaPlayer1.Open;
MediaPlayer1.Wait := false;
MediaPlayer1.Play;
end;
where I've set the MediaPlayer1.Display property to...
I'm trying to 'flash' a statictext label as an alert to the user.
procedure form1.flash;
begin
statictext1.color := clBlack;
statictext1.font.color := clWhite;
beep;
sleep(2000);
end;
(I've left out the restoring of the colors for this thread.)
When this code runs, it beeps, the computer...
I'm trying to play a .wav file which is stored as a resource.
Searching over the Internet, there seems to be two ways.
One uses PlaySound(resourcename,0,SND_RESOURCE or SND_NODEFAULT), which seems real easy.
The other uses SndPlaySound and involves finding, locking and freeing the resource...
I've abstracted this problem to, hopefully, simplify it without losing the key elements.
I have a project with 3 forms that are auto-created: Form1 (the main form), Form2 and Form3.
Form1 has a button whose handler is:
Form2.showmodal;
Form2 has a button whose handler is:
Form2.close...
I want to loadfromfile several images that will be in the directory that the final compiled application will be in. But I won't know in advance what directory the user might place the application.
Is there a way to have loadfromfile (and/or other directory-related functions) look in the...
I'm having trouble understanding the scope of procedures and where they need to be declared.
Suppose I have a form with a button and a label and I have the OnClick event of the button set to change the label caption. Now suppose I want to write some procedure outside the event handler to help...
(Please bear with me; this is my first Delphi application)
I have a number of constants and global variables (variables that all my forms will need access to) to declare.
Where is the best place to do this?
Can I put them in a separate unit and, if so, do I put the 'uses unit' in the project...
The first thing my application needs to do is open a text file and read its contents into a string array that, I believe, will need to be a global variable. Then my main form takes over and does all the interfacing and work.
Where in the project should this initial reading of the file go? It...
I'm trying to design a pretty form (yes, the best way to learn a language is to program a game). I'd like the labels/fields near the top to be on a blue background, near the middle to be on a red background, and near the bottom to be on a green background.
I'm thinking of putting all the...
This has got to be a newbie question...
I have a main form. When a button is pushed, other forms need to open up to display data or allow editing of data. Then I come back to the main form. That's got to be a pretty basic Delphi problem.
What's the best way to switch between the forms...
I'm currently learning Delphi and Object Pascal after many years with other languages. I seem to have a basic misunderstanding.
The prototypical code that's in the first chapter of every book is:
unit Unit1;
type
TForm1 = class(TForm) { The type declaration of the form begins here }
end...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.