listbox how to select

Posted on 1998-03-05
Last Modified: 2010-04-06

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.
Question by:hellfire052497
  • 2

Accepted Solution

mvz121697 earned 100 total points
ID: 1360151
Try this:

var n:integer;
  if n>0 then FontListBox.ItemIndex:=n;

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


Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 125
URL for downloading Google Chrome for Win XP 2 118
Delphi inherited method 6 60
Convert MS Word document to a PDF file 9 60
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now