Solved

Delphi 5  Define the tab width withi text in a memo field

Posted on 2007-04-05
4
3,043 Views
Last Modified: 2008-03-18
Dear Experts,
    The below codes will compute the string and put in into a temp table memo field . What is the tab ( #9) width by default and how do I redefine it ( I want to make it smaller width between column ) .
( Delphi 5 ,Paradox ) . The string consist of Chinese character , and I want to put string in memo field .

*********************************
with sqlMaster do begin
    while (not Eof) do begin
        iCount :=iCount +1;
        s1 := s1 + Trim(SubStr(sqlMasterName.AsString ,iLen +1,6))+#9;
        if iCount =12 then s1:= Trim(s1) + #13;
        Next;
     end;
end;
with tbltemp  do begin
   Append;
   fieldByName('MemoField').Asstring := s1;
   post;
end;
0
Comment
Question by:gohje
  • 2
4 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18858065
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_settabstops.asp

or

http://tinyurl.com/34fhqj

"The EM_SETTABSTOPS message sets the tab stops in a multiline edit control. When text is copied to the control, any tab character in the text causes space to be generated up to the next tab stop.

This message is processed only by multiline edit controls. You can send this message to either an edit control or a rich edit control."
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 250 total points
ID: 18858079
Posted by "Atanas Stoyanov" on Borland newsgroups:

Follows an example usage of the EM_SETTABSTOPS message. You will notice
that the EM_SETTABSTOPS message expects the tabs to be in dialog units. To
convert pixels to units is used the following formula:

DlgU_X := (Pixels_X * 4) / LoWord(GetDialogBaseUnits);


const NumTabs = 5;
var Tabs : array[1..NumTabs] of Integer;
var XdlgUnits : Integer;
begin

  XdlgUnits := LoWord(GetDialogBaseUnits);//X-dialog units
  Tabs[1] := (40 *4) div XdlgUnits;
  Tabs[2] := (80 *4) div XdlgUnits;
  Tabs[3] := (120*4) div XdlgUnits;
  Tabs[4] := (200 *4) div XdlgUnits;
  Tabs[5] := (Memo1.Width * 4) div XdlgUnits;
  SendMessage(Memo1.Handle,EM_SETTABSTOPS,NumTabs,LongInt(@Tabs));
end;
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21156541
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 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

17 Experts available now in Live!

Get 1:1 Help Now