Solved

listbox how to select

Posted on 1998-03-05
2
238 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

11 Experts available now in Live!

Get 1:1 Help Now