473,804 Members | 3,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByV al 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.SetW indowPos(aHwnd, hwndInsertAfter , 0, 0, 0, 0,
Win32.User.SWP_ NOMOVE Or Win32.User.SWP_ NOSIZE)

End Sub
Nov 20 '05 #1
6 1145
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.co m> 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.co m> wrote in message
news:Oy******** ******@TK2MSFTN GP10.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(ByV al 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.SetW indowPos(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
1217
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 base class: #include <iostream> struct A {
8
7004
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 be done by a function generate_ssid() and works fine. next step is to register the ssid in the table session this will be done by the following code: ************************************************************************* function...
24
7702
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 Dispose-Method and call the GC nothing happend!!! my Disposemethod has never been called!! so the GC dont call my Dispose-Method although I implemented IDisposable? what am i doing wrong?
44
2781
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
1870
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
2357
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 method. Then the access violation no longer occurs! The following class (condensed from the NetCDF C++ interface): class NcVar : public NcTypedComponent
9
2728
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 hide this method within A so that classes instantiating A don't see it?
8
5747
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 private methods in the same class as method arguments. For example, if Public method Foo() calls private method Bar(), and if Bar() uses member variable m_MyVariable, I declare the private method with the signature: private void Bar(SomeType...
3
1766
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 simpler way for other programmers to access that method, such as this: var MyFunc = MyObject.MySub.MyMethod So they could just call MyFunc() instead. This "proxy" or "shorthand" works great in IE, but fails in Firefox/Safari and sometimes even...
0
9582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
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...
0
10335
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
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
10082
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...
1
7621
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
5525
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
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.