Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Newbie Questions

Posted on 2004-10-27
8
Medium Priority
?
203 Views
Last Modified: 2010-08-05
1-I am trying to add a new form!
how to do that, I went NEW >> FORM and I got a new one. but each time I type Form2. in Form1 this error gets in the way
Form2 is in Unit2 and form1 in unit1
is that sapposed to be like this?

Build
  [Pascal Error] Unit1.pas(1): Unable to invoke Code Completion due to errors in source code

2- In VB there is ListBox which is MemoBox in Delphi
There is also ListView, what is it in delphi? and how to use it?
The difference ListView has many columns not only many rows, each column may have a title...
0
Comment
Question by:instant_new
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 2

Expert Comment

by:DeNavigator
ID: 12424524
What error do you get?

Maybe this is your solution:
add unit2 to the uses clause in the implementation section of unit1
then do something like:

begin
  Form2 := TForm2.Create(self);
  try
    Form2.ShowModal;
  finally
    Form2.Free;
  end;
end;
0
 
LVL 2

Expert Comment

by:DeNavigator
ID: 12424544
Second part:
ListView is also a component in Delphi on the Win32-tab. If you want columns put de view style to vsReport. You can (and must) add the columns via the columns property
0
 
LVL 31

Expert Comment

by:moorhouselondon
ID: 12424547
If you click on the Form, press F11, you will see the Name of the form is Form1.  Try changing it to something else there.  But if you want to change the Main Form then this can be changed in Project, Options, Forms, Main Form.

The Unit name is when you pull down and Save the pas file, and this can be called something more meaningful too (but not the same name as the form - I stick an f in front for the Form).
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:moorhouselondon
ID: 12424573
"But if you want to change the Main Form then this can be changed in Project, Options, Forms, Main Form."

Let me clarify that:  ...if you want to change where the program starts running from then this can be changed....
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 12425474
you need to add "uses Unit2" in your unit 1 "uses" clause at the top.
If you need to see form1 from form2, you will need to add 'uses uni1" in the "implementation section (not at the top)
otherwise you will get a circular reference

TListView is in the Win32 Tab of the component palette
Drop 1 on your form, and set it's ViewStyle to vsReport
you can now right click on the listview and add columns and items.
0
 

Author Comment

by:instant_new
ID: 12442403
the only one that worked is DeNavigator's answer but it has problems
Im getting
Build
  [Error] Unit1.pas(23): Undeclared identifier: 'self' //<< Form2 := TForm2.Create(self);
  [Error] Unit1.pas(29): '.' expected but ';' found //<< end;
  [Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas'
I changed self to Form2, but I still have the second problem.
can you help?
0
 
LVL 2

Accepted Solution

by:
DeNavigator earned 200 total points
ID: 12442442
You should place this code in the OnCLick Event of a button like:
procedure TForm1.Button1Click(Sender: TObject)
begin
  Form2 := TForm2.Create(self);
  try
    Form2.ShowModal;
  finally
    Form2.Free;
  end;
end;

This should clear your bugs. :)
0
 

Author Comment

by:instant_new
ID: 12452769
solved the problem
thanks all
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question