AutoHotkey Community

It is currently May 27th, 2012, 4:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: June 22nd, 2011, 4:58 am 
Offline

Joined: April 14th, 2011, 2:21 am
Posts: 30
Can somebody show me how to make the text display in the middle (vertical) of the Gui Edit control


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 22nd, 2011, 7:32 am 
Offline

Joined: May 12th, 2005, 8:20 am
Posts: 331
Location: Münster, Germany
Hi, zeus19,
try something like this:
Code:
Gui, Add, Edit, w100 Center
Gui, Show
return
This will do the job!
Regards,
Klaus


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 22nd, 2011, 7:49 am 
Offline

Joined: April 14th, 2011, 2:21 am
Posts: 30
It's not that, I want the text in the center but vertical way, not horizontal. Like this:

Image

Uploaded with ImageShack.us

When I start input, the text always state in the middle like in excel


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 22nd, 2011, 8:35 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
Hi zeus19, welcome.

You question is too vague. There are many ways to put your cursor in the middle row, (if that is what you actually want to do.)

Here is an example. If you want something different, you need to post some code, so we can better undstand what you want.
Code:
#Singleinstance force

text:="`r`n this is a test"

Gui, Add, Edit, w200 r3 Center, %text%
Gui, Show
return


guiclose:
exitapp


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 22nd, 2011, 8:51 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
zeus19 wrote:
how to make the text display in the middle (vertical) of the Gui Edit control


Is it a single or Multi-line edit control?

Edit: Never mind the question.

Either way, you need to find the height of the text ( for the font+weight you use ) and compute the draw area and then call EM_SETRECT Message in a GoSub Label.

Source: Vertically centering text in a (single-line) edit/static control

Unfortunately, I do not have the time right now to produce a sample.
Maybe later, If somebody else does not.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 23rd, 2011, 3:31 am 
Offline

Joined: April 14th, 2011, 2:21 am
Posts: 30
SKAN wrote:
zeus19 wrote:
how to make the text display in the middle (vertical) of the Gui Edit control


Is it a single or Multi-line edit control?

Edit: Never mind the question.

Either way, you need to find the height of the text ( for the font+weight you use ) and compute the draw area and then call EM_SETRECT Message in a GoSub Label.

Source: Vertically centering text in a (single-line) edit/static control

Unfortunately, I do not have the time right now to produce a sample.
Maybe later, If somebody else does not.


Thanks Skan, and could you produce an example? I try to do it myself but it's too hard for me (I'm a newbie in programing). Thanks in advance!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Leef_me, rbrtryn and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group