Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 4 Jahren, 7 Monaten
Letzter Beitrag:
vor 4 Jahren, 7 Monaten
Beteiligte Autoren:
Clarion Ghost, Piet van Zanten, GuenterP, Al

How do I force an Edit Box entry to left align

Startbeitrag von Clarion Ghost am 18.08.2013 07:03

How do I force an Edit Box entry to left align?

I am looking for something like this:-

Customer.FirstName = LEFT(Customer.FirstName)

What I am trying to achieve is to prevent or remove spaces being entered into an empty edit box or spaces being entered that precede an otherwise valid entry.

Many thanks.


Hi, how about using NoSpace(...) ?

MyEditX = NoSpace(MyEditX)

von GuenterP - am 18.08.2013 07:21
Hi Guenter,

Just tried MyEditX = NoSpace(MyEditX). It works with a visible entry but seems to ignore just 'spaces'.

von Clarion Ghost - am 18.08.2013 07:55
Hello Ian

Your signature tag indicates you are only interested in Webdev - is this a Webdev or Windev question as my answer for Windev but it may apply to Webdev

You are asking two separate things.

The left alignment is handled in the field definition by using the GUI alignment option

Checking for a leading space is another issue and can be handled on the exit by using nospace() as Guenter suggested. If you need to check for a leading space during data entry then there may be an answer in the the help text for ..Cursor
You will probably end up writing code into the "Whenever modified" field event to check the asc() values of the first x characters that have been entered or it may be easier to test for If KeyPressed(VK_SPACE) = True


von Al - am 18.08.2013 09:16
Hi Ian,

If you are just talking about left align, then you go to the style tab in Webdev, choose element: input area, alignment, left.
If you actually want to remove preceding spaces, then Guenter's way is the way to go.
You can put the code in the Browser Exit code of the control.


von Piet van Zanten - am 18.08.2013 13:04
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.