Solved

listbox how to select

Posted on 1998-03-05
2
246 Views
Last Modified: 2010-04-06
hi,

I have a listbox which contains all the available fontnames but how do I assign the current font to be selected in the listbox

example FontlistBox.? := Richedit1.Font.Name , I tried Itemindex but that requires a number.

also I need this in a caption, Pe' but when I use Open.Caption := 'Pe'' It gives unterminated string, any ideas here.
0
Comment
Question by:hellfire052497
[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
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
mvz121697 earned 100 total points
ID: 1360151
Try this:

var n:integer;
begin
  n:=FontListBox.Items.Indexof(RichEdit1.Font.Name);
  if n>0 then FontListBox.ItemIndex:=n;
end;


For your second question, use a double apostoph :
so it becomes  'PE'''

Greetings,
MvZ
0
 
LVL 2

Expert Comment

by:mvz121697
ID: 1360152
By the way, in the above example i ment 4  _single_ quotes !
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 121
Performance of SQL statement 37 137
Problem working with dynamic array - help 2 36
Way to create an iPhone app for my customers 8 47
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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