Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-04-05
4
Medium Priority
?
3,242 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
[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
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 1000 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

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 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