473,382 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Control placements don't seem to compute

I am studying basic visual basics graphics.

Form1 size is 500, 500. (Of course, location is 0, 0)

Textbox1 size is 100, 100

Textbox1 Location is 400, 400.

Can anyone tell me why the lower right corner of the text box does not coincide with the lower right corner of Form1?
Sep 11 '12 #1

✓ answered by Guido Geurs

First of all: a pixel is 15 twip.
So if you want to work on the precise pixel, you have to use a multiple of 15 like :
480 or 505 for the form
90 or 105 for top and left
390 or 405 for the textbox.
Also don't forget to set the border of the form to NONE , the Controlbox to false and nothing in the Caption.

4 1371
Guido Geurs
767 Expert 512MB
First of all: a pixel is 15 twip.
So if you want to work on the precise pixel, you have to use a multiple of 15 like :
480 or 505 for the form
90 or 105 for top and left
390 or 405 for the textbox.
Also don't forget to set the border of the form to NONE , the Controlbox to false and nothing in the Caption.
Sep 11 '12 #2
Thank you. It is very kind of you to answer a beginner's question. After playing with the factors you gave me I now understand why I was not getting the anticipated placement.
Sep 12 '12 #3
Killer42
8,435 Expert 8TB
Guido, doesn't the twips-per-pixel ratio depend on screen size and/or resolution? Haven't played with it for a bit.

I know it's usually 15, but to be safe I always use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY rather than hard-coding.

Admittedly, it may seem silly trying to future-proof code written in a twelve-year-old programming language.

(Note, in many cases you can avoid the whole issue by setting ScaleMode to 3 - Pixel.)
Sep 17 '12 #4
Guido Geurs
767 Expert 512MB
Killer42,
I don't think twips-per-pixel depends on screen.
The definition of twips in the help of VB:
"A screen-independent unit used to ensure that placement and proportion of screen elements in your screen application are the same on all display systems. ..."
But yes, it's better to work with "3-Pixel" as scalemode in the form settings.
Sep 17 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mm | last post by:
the code public static Main() { enum Test { one = 1, two = 2, three = 3
1
by: Tom Schindl | last post by:
Hi, the following Statement worked on MySQL 4.0 but after upgrading to 4.1.12 on win32 the order is not working any more. Is this a known problem or is our SQL simply not useable on 4.1 or is...
1
by: Jarrod | last post by:
Hallo, Have just created a small ASP .Net App with VS 2003 for the first time in years. After Building a release I proceed and uploaded my folder onto the wwwroot. The aspx pages just throw an...
2
by: B Vidyadhar Joshi | last post by:
After trying out various methods, I couldn't get the below structure to work. I read on some forum that combining value to type and reference type in a is not valid. And to implement a union...
0
by: Glenn Venzke | last post by:
I'm using a ColdFusion app to consume a .NET webservice with 3 methods and I'm running into a problem. The first time I added a web reference & compiled the service (with VS.NET standard edition...
0
by: yousuf | last post by:
I have a dataList that pulls from a database table - Im trying to do the normal Edit, Update, Delete, Cancel - on it. when I put the following inside a user control - .ascx file it dosn't work,...
1
by: illegal.prime | last post by:
I would like to have an array of objects (whose class I define) and then just invoke either: MyClass clonedArray = (MyClass) myArray.Clone(); OR Array.Copy(myArray, clonedArray, myArray.Length);...
1
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains...
0
jlm699
by: jlm699 | last post by:
Greetings all, I have this server (running on Linux 2.6.17-gentoo-r9) that I've been tinkering with and I attempted to do a multi-threaded model to accept multiple connections, however I found...
1
by: Stuart Brockman | last post by:
Hi, I don't quite get what is going on in this code example: --------------------------- #include <iostream> using namespace std; class Base{ public:
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.