473,385 Members | 1,930 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,385 software developers and data experts.

Alway On Top method no longer works for me

Below is what I did in VB6 to set a form to be on top.

It nolonger works.

Questions:

Is there a reason to expect it to not work because of the new VS?

Is there a reason to expect it to not work in XP?

Is there an approach that does work?

THANKS

Public Shared Sub AlwaysOnTop(ByVal aHwnd As System.IntPtr, ByVal OnTop As
Boolean)

Const HWND_TOPMOST As Integer = -1

Const HWND_NOTOPMOST As Integer = -2

Dim hwndInsertAfter As Integer

hwndInsertAfter = VB.IIf(OnTop, HWND_TOPMOST, HWND_NOTOPMOST)

Win32.User.SetWindowPos(aHwnd, hwndInsertAfter, 0, 0, 0, 0,
Win32.User.SWP_NOMOVE Or Win32.User.SWP_NOSIZE)

End Sub
Nov 20 '05 #1
6 1120
Cor
Hi Sam,

To make it understandable for me, is this the same as the property.

me.topmost = true

Cor
Nov 20 '05 #2
* " SamSpade" <st**************@REMOVEaol.com> scripsit:
Below is what I did in VB6 to set a form to be on top.


Set the form's 'TopMost' property to 'True'.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #3
Cor
Hi Herfried,

You spoil my message.

:-(

Cor
Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
You spoil my message.


Sorry, sync problems today :-(...

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Nov 20 '05 #5
To make it understandable for me, is this the same as the property.

me.topmost = true

Sure sounds like it!

Thanks for both replies
" SamSpade" <st**************@REMOVEaol.com> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
Below is what I did in VB6 to set a form to be on top.

It nolonger works.

Questions:

Is there a reason to expect it to not work because of the new VS?

Is there a reason to expect it to not work in XP?

Is there an approach that does work?

THANKS

Public Shared Sub AlwaysOnTop(ByVal aHwnd As System.IntPtr, ByVal OnTop As
Boolean)

Const HWND_TOPMOST As Integer = -1

Const HWND_NOTOPMOST As Integer = -2

Dim hwndInsertAfter As Integer

hwndInsertAfter = VB.IIf(OnTop, HWND_TOPMOST, HWND_NOTOPMOST)

Win32.User.SetWindowPos(aHwnd, hwndInsertAfter, 0, 0, 0, 0,
Win32.User.SWP_NOMOVE Or Win32.User.SWP_NOSIZE)

End Sub

Nov 20 '05 #6
Cor
Hi Sam,

If you want your form always on top, Yes

Cor
Nov 20 '05 #7

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

Similar topics

8
by: Pete Vidler | last post by:
Hi folks, I have a small hierarchy with a virtual method which is overridden in the most derived class. I also have a method that needs to call two versions of this.. the most derived and the...
8
by: Johannes A. Brunner | last post by:
Got a simple problem. I code some site and because Im a freak I made my own session-handling. When a user open up my site it will check if there is a ssid in the url if not generate one. this will...
24
by: Jazper | last post by:
hi i have this problem. i made a class deverted by CRootItem with implementation of IDisposable-Interface. i made a test-funktion to test my Dispose-Method.... but when set a breakpoint in my...
44
by: gregory.petrosyan | last post by:
Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ????) print x All I want is to make self.data the default argument for self.f(). (I
19
by: Flavio | last post by:
hi, I have an object defined with a number of hardcoded methods. Class soandso: def __init__(self): self.this = 0 self.that = 1 def meth1(self): ...
10
by: Markus Svilans | last post by:
Hi, I have a weird problem in a virtual method. The original method code raises an access violation when it is run. The solution to the problem is to declare a dummy integer inside the virtual...
9
by: Andrew Robinson | last post by:
I have class A which inherits from class B. B contains the following virtual method: public virtual List<TSelect() { return new List<T>(); } Is there any way to make private or otherwise...
8
by: David Veeneman | last post by:
Should a member variable be passed to a private method in the same class as a method argument, or should the method simply call the member variable? For years, I have passed member variables to...
3
by: Arodicus | last post by:
I have a static class method, MyObject.MySub.MyMethod(), which points to a handler in a Flash SWF (but I think that's inconsequential). In reality, the path is a lot longer, so I'd like to make a...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.