Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


2 pixel displacement


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-29-2007, 06:03 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 672
Default 2 pixel displacement

Hi,

I am wondering about this strange behaviour:

I have created a Form1 and added a Label1 with the designer. Label1 has the following properties:
top = 50
left = 100
width = 50
height = 20

After that, I added this code:
Code:
Sub Globals
End Sub

Sub App_Start
	Form1.Show
	AddLabel("Form1","Label2",50,Label1.Top,Label1.Width,Label1.Height,"Label2")
	AddLabel("Form1","Label3",150,Label1.Top + 2,Label1.Width,Label1.Height,"Label3")
End Sub
If I start this code on the desktop, I can see (as shown in the attachment):
- Label1 is the reference
- Label2 is displaced (2 pixels HIGHER than Label1)
- Label3 has the same top position as Label1

If I start that code on the device I'll get the (estimated) result:
- Label1 is the reference
- Label2 has the same top position as Label1
- Label3 is displaced (2 pixels LOWER than Label1)

So why does this happen on the desktop?


specci48
Attached Images
File Type: jpg LblPosition.jpg (3.9 KB, 7 views)
Reply With Quote
  #2 (permalink)  
Old 08-29-2007, 06:50 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

It looks like the designer created and the manually created labels don't have the same font size.
If you'll explicitly set the font size they should be properly aligned.
It will be fixed in the next update.
Reply With Quote
  #3 (permalink)  
Old 08-29-2007, 07:04 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Interesting!

If you set the background colours different to that of the form you can see that the labels are all in the correct position, it is the position of the text within the added labels that is different.

A further peculiarity, on my system at least, is the the label added at design time with the default background colour has the same colour background as the form, whereas those added at runtime have a different, slightly darker background colour.

Last edited by agraham : 08-29-2007 at 07:10 PM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ploting just one pixel colin9876 Questions & Help Needed 1 11-30-2007 07:38 PM
Fastest way to get pixel colour value? DavidN Questions & Help Needed 6 09-02-2007 07:40 AM


All times are GMT. The time now is 06:31 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0