Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: jjschwartz
  • Content: Threads
  • Order by date
  1. jjschwartz

    Auto-adjusting font size

    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...
  2. jjschwartz

    Faux copy protection

    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...
  3. jjschwartz

    Form position different on different machine

    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...
  4. jjschwartz

    Trouble showing Mpeg in window

    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...
  5. jjschwartz

    Unusual behavior from sleep()

    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...
  6. jjschwartz

    Playing .wav from resource

    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...
  7. jjschwartz

    Why won't my modal form close?

    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...
  8. jjschwartz

    LoadFromFile from directory

    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...
  9. jjschwartz

    Where should procedures go

    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...
  10. jjschwartz

    Structure of a unit/application

    (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...
  11. jjschwartz

    Where should this code go?

    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...
  12. jjschwartz

    Making pretty forms

    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...
  13. jjschwartz

    Juggling between several forms

    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...
  14. jjschwartz

    Basic question about Object Pascal

    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...

Part and Inventory Search

Back
Top