473,836 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem to locate form

hi,
I've problem to locate form on screen.
I'd like to show modal form near a textbox after user click on it.
here is the code:
Private Sub myTextBox_Mouse Down(ByVal sender As Object, ByVal e As (...)
Dim r As New Rectangle(TextB ox.Width, 1, 16, 18)
If r.Contains(New Point(e.X, e.Y)) Then
With popUp
.DesktopLocatio n = PointToScreen(N ew Point(r.Right - popUp.Size.Widt h,
r.Bottom + 2))
.Show()
End With
End If
End Sub

form popUp is hidden at start. after user click on textbox the popUp should
appear bottom of textbox.
and it does, but the first time popUp appear somewhere on the screen.
next I click on the textbox everything works fine.
the question is why it doesn't work first time?!

jaro

Nov 20 '05 #1
3 1173
Hi Jarek.

Some questions:
How are you creating popUp?
What do you mean by 'hidden'?
- New only
- New, loaded but never visible
- New, Loaded, shown and hidden.
- something else

One possible workaround.
Set the Location
Call Show
Set the Location again.

Doing this, the first showing of the form may cause a 'jump' but it will
end up in the right place.

Regards,
Fergus
Nov 20 '05 #2
Fergus Cooney wrote:
Hi Jarek.

Some questions:
How are you creating popUp?
What do you mean by 'hidden'?
- New only
- New, loaded but never visible
- New, Loaded, shown and hidden.
- something else

One possible workaround.
Set the Location
Call Show
Set the Location again.

Doing this, the first showing of the form may cause a 'jump' but
it will end up in the right place.

Regards,
Fergus


hi Fergus,
thx for reply.
popUp form is created from code and is "- New, loaded but never visible".
I knew that setting location twice form is jumping on the screen.
How to display this form just in place I want without 'jump effect'?

jarek
Nov 20 '05 #3
Hi Jarek,

I believe the problem is caused by the
New, loaded but never visible

What I'm thinking is happening is that you have Form.StartPosit ion set to
WindowsDefaultL ocation. So Windows gets to decide where your Form appears.
This will happen the first time that it is shown. Thereafter it'll be fine -
wherever you last placed it.

Try setting it to Manual and see if that improves things. If not, set it's
initial; coords so that it's off the screen (or just showing a single pixel or
somthing).

If it's then still jumping, you'll have to post some code for - popUp New,
Init and Load and where it is declared and created in the main form.

Regards,
Fergus
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1913
by: Eric E | last post by:
Hi all, I have a fairly complex form in Access 2000. In particular, it has two subforms on separate tabs of a tab control. For the last two weeks, I've encountered the dreaded : "You can't carry out this action at the present time." error, runtime 2486. Subsequently Access will not exit the form, and shuts down uncleanly. Looking back on the messages here, this seems to be an indication of a corrupt object in the .mdb. So I imported...
0
1098
by: Volkan Karaboða | last post by:
Hi all... I have an interesting problem with response.redirect func. I have used this statement to locate other pages in my app. but It doesnt work on win2003 server and framework 1.1.4322 but it works on xp machine and same framework. Whwn I want to locate any pages with using response.redirect , page seems empty I mean any control on the form doesnt seen. When I trace app, pages are not proceed with response.redirect and to prevent...
5
1256
by: Simon Verona | last post by:
I have a strange problem with a Windows Forms application. It installs and runs fine on my development machine but consistently comes up with errors on any installed machine. I get an error about an unhandled exception as the application starts up. If I go to debugger I get the error showing as : Unhandled exception generated: (0x04941b54)
13
3946
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that .NET creates i get the following error message: "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in VisioTimeline.exe
7
1369
by: salla83 | last post by:
I have a wab page with pattern : <a name="a">a</a> <a name="b">b</a> <a name="c">c</a> <a name="d">d</a> <a name="e">e</a> i put anchor links to be able to locate on every item. And at the top of the page i have a form including only a textbox and a submit button. now what i want to do is either with javascript or something else, locate on the item which has the anchor name value equal to the string which is entered by the user to the...
3
3818
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed an empty label control on a form. I could drag the mouse across the form in design view to locate the lbl. But I have since moved a few controls on the form around, and now I cannot locate this label control. Is there a way to select the label in the design view besides dragging the mouse? Thanks, Rich
12
15682
by: jcor | last post by:
Hi, I'm using Ubuntu 7.04. I'm writing a sript that sends files via ftp for several destinations. So far I used Net::FTP and it worked fine. My problem is that I need to send files via SFTP (SSH2). I've been trying to install Net::SFTP with 'sudo perl -MCPAN -e "install NET::SFTP' but I can't. It stops in the middle of the installation: Crypt-DH-0.06/t/ Crypt-DH-0.06/t/00-compile.t
4
1684
by: Neil | last post by:
Having trouble with inserting a record into a table. It's a list of names. But, for some reason, it won't take a particular name. When a user tries to enter a name into the table, the system hangs (users are using Access 2000 via ODBC linked table). I went into QA (SQL 7) and tried an Insert Into statement, but I got the same result from QA: the system just hung. No error message. After 5 minutes, the query was still trying to execute. ...
2
3019
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that. Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10818
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10565
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10237
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4436
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.