Window Styles (No Border)
Wht I want to do is set the style of a window (of another application) like VB's "0 - None", or to remove the window border.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Heres a question I need solved. What if one of your main forms is using a border style of fixed single(1) When running the application and you press the close icon at the top right, how do you get it to end the process as currently it seems to hide the application but not end the process
Much help would be appreciated.
I use the following code (from PlanetSorceCode.com) to set the border style of a user control. The code works great, I was wondering if anyone knows the constants for other border styles.
''## Border Styles
Private Const GWL_EXSTYLE As Long = (-20)
Private Const GWL_STYLE As Long = (-16)
Private Const SWP_NOMOVE As Long = &H2
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_NOZORDER As Long = &H4
Private Const SWP_NOACTIVATE As Long = &H10
Private Const SWP_FRAMECHANGED As Long = &H20 ' The frame changed: send WM_NCCALCSIZE
Private Const SWP_NOOWNERZORDER As Long = &H200 ' Don't do owner Z ordering
Private Const WS_EX_CLIENTEDGE As Long = &H200
Private Const WS_EX_STATICEDGE As Long = &H20000
Public Property Let Appearance(ByVal New_Appearance As AppearanceConstants)
Dim lStyle As Long
menmAppearance = New_Appearance
lStyle = GetWindowLong(UserControl.hwnd, GWL_EXSTYLE) 'Retrieve current style
Select Case New_Appearance 'Toggle style flags
Case [Flat]: lStyle = lStyle And Not WS_EX_CLIENTEDGE And Not _
Case [3D]: lStyle = lStyle Or WS_EX_CLIENTEDGE And Not WS_EX_STATICEDGE
Case [Thin]: lStyle = lStyle And Not WS_EX_CLIENTEDGE Or WS_EX_STATICEDGE
SetWindowLong UserControl.hwnd, GWL_EXSTYLE, lStyle 'Apply changes
SetWindowPos UserControl.hwnd, 0, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOZORDER Or _
SWP_FRAMECHANGED Or SWP_NOSIZE Or SWP_NOMOVE
How To Set Picturebox Border Styles In Vb?
how to set border styles in picture box in vb?
here border styles nothing but
doted line and so on.....
any body nows please heflp me as soon as possible
thnks and with regards
Popup Menu And Border Styles
why is it that i cannot set the forms border style to none, and still have a popupmenu?
i am trying to get a form in a minimal state with no titlebar, but i would like a popupmenu to come up when the user right clicks the form. currently i have the popupmenu not visible until right click is hit, but when i put menus in my form, it will put a border (title bar) on the form no matter what i do..
any suggestions please forward them.
> > > Switching Border Styles In Forms
Pleeeese help me!
I need to be able to switch form border form fixed toolbox to None, but when i do i get an "left hand variend error". Can anyone please help me?
please e-mail me at email@example.com
What window style could I use to allow for the cursor to be placed on the right hand side of a textbox, instead of the default left hand side?
Removing Window Styles
In C++ you can use something like this to remove a window style:
void RemStyle(DWORD Style)
Styles &= ~Style;
How would you do this in vb?
dim Styles as long
sub RemStyle(Style as long)
Styles = Styles And <something>Style
SetWindowLong <hwnd>, GWL_STYLE, Styles
I'm not sure what you would use instead of ~.
Getting A List Of Window Styles...
Is there a way to determine what styles a window has, other than running through a list and testing each one against GetWindowLong()? Like Spy++ gives you a list of the current styles that a window has, does it just test each one, or is there a better way?
How To Change Window Styles...
Under Windows 2000 or something similar (not XP) how would I go about changing the window styles in VB? such as for title bar, menus, etc..
not just for my program but on teh whole system
SetWindowRgn API With XP Window Styles
I have a form that I want to cut a square hole out of a standard VB form. I use standard region API calls and this works fine.
However, I find that whenever I use SetWindowRgn, I lose the "Windows XP" look of the form - ie. the form reverts to "Windows Classic" appearance, without the rounded title bar and blue frame.
Is this avoidable? Ideally, I'd like to keep the XP form look when using my app in XP. Has anyone help come across this and have a solution?
Thanks in advance to anyone who can help!
Cross Process Window Styles
I need to change the style flages of a window that is not in the same process as my program. SetWindowLong (with gwl_style) only work withing the calling process. How do I change the style flags on a window outside my program's process?
Window Styles WS_VSCROLL/WS_HSCROLL And The Frame Control
When I use SetWindowLong with the above style bits I can make a Frame control show scrollbars but, unlike other container controls, these scrollbars never generate WM_VSCROLL or WM_HSCROLL messages - it is as if the non client area of these controls is always disabled?
Any thoughts on how to get them to work?
Thanks in advance,
How can I change the border of a Window at run time ?
Redraw Window Border
It's me again...
I want to know if it's possible to redraw the window border with a 1px black line for example...
I would like to keep the sizing functionality from "Borderstyle - 2".
With Friendly Regards,
Removing A Border From A Window
Hey I am using the mcisendstring api so that I can play an avi video in VB. I have got that working fine. Anyway there is a border around the video when it plays with the cross, minimise and maximise symbol. I want the video with no border. Does anyone know how i would do it.
Here is my code.
Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long
i = mciSendString("open c:myvideo.avi type avivideo alias video1", 0&, 0, 0)
i = mciSendString("play video1", 0&, 0, 0)
Can I Read If A Window Has A Border Or Not??
I am trying to find out through my program if the WinDVD window is in normal windowed mode(with borders and captions) or in fullscreen mode(with none of these).
Is it possible to read from it using sendmessage, if it is fullscreen or not.
It may be like the "Border Style" property in visual basic.
!!! Resizing A Window - With No Border. !!!
I'm trying to make a form appear as if the BorderStyle was set as 0 - None and still allow the user to manually resize the window. (Hover the cursor over the very edge of the form, click and drag out the new window size)
It seems that whenever the frame thickness is reduced to nothing, the manual resize feature has no effect.
I am currently fiddling with this code:
Private Const GWL_STYLE = (-16)
'''Every single Window Style Constant known to man kind
Private Const WS_BORDER = &H800000
Private Const WS_CAPTION = &HC00000
Private Const WS_CHILD = &H40000000
Private Const WS_CHILDWINDOW = (WS_CHILD)
Private Const WS_CLIPCHILDREN = &H2000000
Private Const WS_CLIPSIBLINGS = &H4000000
Private Const WS_DISABLED = &H8000000
Private Const WS_DLGFRAME = &H400000
Private Const WS_EX_ACCEPTFILES = &H10&
Private Const WS_EX_DLGMODALFRAME = &H1&
Private Const WS_EX_NOPARENTNOTIFY = &H4&
Private Const WS_EX_TOPMOST = &H8&
Private Const WS_EX_TRANSPARENT = &H20&
Private Const WS_GROUP = &H20000
Private Const WS_HSCROLL = &H100000
Private Const WS_MAXIMIZE = &H1000000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZE = &H20000000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_OVERLAPPED = &H0&
Private Const WS_POPUP = &H80000000
Private Const WS_SYSMENU = &H80000
Private Const WS_TABSTOP = &H10000
Private Const WS_THICKFRAME = &H40000
Private Const WS_TILED = WS_OVERLAPPED
Private Const WS_VISIBLE = &H10000000
Private Const WS_VSCROLL = &H200000
Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(hwnd, GWL_STYLE)
lStyle = lStyle Xor WS_CAPTION Xor WS_THICKFRAME
SetWindowLong hwnd, GWL_STYLE, lStyle
Width = Width + 15
Width = Width - 15 'Just to refresh the form
Also, what effect does "Xor" have and how does it work?
But most importantly, how would you go about having no window border, and still allow the user to manually resize the window.
(Possibly 4 labels on the far top, bottom, left and right areas oft the form with transperancy triggering a RESIZE LEFT or RESIZE RIGHT etc. on Mouse_Down?
Or better yet, a correct combination of the WS Constants?)
No Border On Window - Want To Resize
If I have a window with its border style set to none, how can I make it resize like how someone would resize a normal window by clicking and draging on the corner?
How To Set A Window's Border Style
I want to change a window's border style from sizable to non-sizable.
I have been trying to do this by using setwindowlong, and using combinations of WS_DLGFRAME, WS_BORDER etc etc., however, I have no luck.
Also trying to use code like me.borderstyle=3 doesn't work either.
Can some lend a hand on the API code?
Resize Fixed Border Window.
I got a program that got a fixed border. The button i'm supposed to click is outside the border. I need to make a program that resized other fixed border windows.
Can this be done?
Borderless Window With Menu (Forces Border)
Is there any way to have a borderless form that contains hidden menus (for a NotifyIcon)? I NEED this form to be borderless but when you add ANY menu (visible or not) it adds a border...
Is there any code to remove this border or... any way I could call this menu from a different form that isn't showing... or make a menu somehow with code in a module (so it doesn't add a border to the form)?
( VB Newbie here, go easy on me... )
Show A Form With Fixed Tool Window Border Style In Taskbar?
I've got a small form that pops up prior to sending data to another form to allow user to select a different comm port. The form's border style is 04 (Fixed Tool Window), and I'd like to show the window in in the task bar because it's easy to lose if there's several windows open. Is this possible?
CoolBar+XP Styles+Toolbar <> XP Styles
I am having trouble getting the styles on the toolbar and coolbar to work together. When I add a manifest file the project the coolbar gets the new XP style and the toolbar is still flat and gray. Is there anyway around this?
I have some projects that use XP Style visualization if the operating system is Windows XP; I also prevent errors that occour (in some circumstances) when you close the program.
The question is simple:
Can I use XP Style when the program runs in the IDE?
Hi, im trying to get my app to use the xp styles (as you probably guessed). Ive looked at http://www.vbaccelerator.com/home/VB...VB/article.asp and i swear i follwed it to the letter but my app will not load, i just get an error sound from my speakers.
I copyed and pasted the manifest code and this is what ive got in my app:
Private Const ICC_USEREX_CLASSES = &H200
Public Function InitCommonControlsVB() As Boolean
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
' Ensure CC available:
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
InitCommonControlsVB = (Err.Number = 0)
On Error GoTo 0
Public Sub Main()
Private Sub Command1_Click()
MsgBox "test Message"
I complied it as test.exe and my manifest is called test.exe.manifest
Public Sub Main()
Private Sub Command1_Click()
MsgBox "test Message"
and as expected that didnt work either.
i think im doing something thats so obvious that im gonna look stupid for posting this :/
I am trying to use the tab style on a form, but I can not get the color to change from that horrid grey... the controls will only let me change the background color, not the app work space... anyone?????????
I want my documents to be formatted with Heading 1 and Body Styles. I have a macro to format with heading1 and another macro to format with body style.
After I put my heading in Word wants to use the normal style. I tryed to changed normal.dot to show that the style following heading 1 should be body but no matter what I do it seems Word changes it back to normal.
What is the correct way to change Heading 1 so that body style always follows it?
I m using windows XP.Can i use Win XP Style in my VB Application that will also work in win98 and win ME.
XP Styles Help [vb6]
I need to add XP Styles to my Project.
Can someone link me to a tutorial?
XP Styles In VB6
I've gotten VB6.EXE to load XP styles with this manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
VB6.EXE loads fine and loads the style fine, and my app has the VB style, but when I compile my app and try the manifest with that, my app opens then immedietly closes.
I've searched high and low for how to do this, and I keep seeing http://www.vbforums.com/showthread.php?t=234280&highlight=winXP+Styles same solution to getting my app to show as XP style app. However, I cannot seem to get it to work, at all.
I've saved the manifest file as myappname.exe.manifest and included the required code in my main app form, as well as attempted it in my main startup sub.
These are some screenshots of references and components. When I try to add the comctl32.dll I get a "Can't add a reference to the specified file" error.
For some reason these linkswon't click to the pics, so you'll have to copy then to you browser...
How Can You Add XP Styles To A Dll?
I have a dll that loads when microsoft outlook is loaded..
this dll also has a form with it, one that loads when a button is clicked in outlook. How can i get this form to have XP Style?
Win XP Styles
could someone show me a source code on how 2 use WinXP visual styles in VB apps?
Are there any available toolkits for VB that give different style UI frameworks ?? Such as DevStudio, Outlook, Explorer etc....
I suppose I am really looking for the VB equivalent of the MFC CJLibrary at CodeGuru... Is there such a beast ???
Hope someone can help
Manifest XP Styles
I have successfully installed the .manifest from posts on this site. This is the result that I get.
Things to notice:
The Frame around Marital Status is not like the other frames (option controls used inside frame) and the command buttons are not drawn correctly.
Here is the fix ---
From previous threads, I have read that placing a picture box on the screen would solve the option control to display correctly. I applied this theory to both frames within a frame (as in my case) and command buttons within a frame
I set the border style property of the picture box to 0 - None. Place the picture control inside the frame and then place the control inside the picture box.
Hope this helps for anyone else dealing with manifest files or XP Styles
Help Making Vb6 Use Xp Styles
i found a script that lets me use window xp buttons in visual basic 6 apps. u know the cool looking rounded buttons. do u know how i can have everything be xp style? like textboxes,progressbar,check boxes,radio boxes, and those stuff. i tried google but i could only fidn stuff for vb.net if u know any dlls or user control scripts then could u plz tell me?
I have looked, and looked.And darn, still have not found a thing on it.
What I want to do is make a Visual Style editor/maker, but I have not found a thing on how a visual style is even made.Is it just a 'manifest' stored somewhere for the entire system?
XP Styles Flicker
I've been changing my app over to use XP styles following the suggestions in many of the posts here and elesewhere.
Everything is fine except for two things...
1.) The captions of some frames are cut short. I've messed with a few settings, like using the Button Face color, and changeing the font size, and type. But nothing seems to work.
2.) As I mouse around the forms, the label controls flicker.
Any ideas on this would be helpful. Thanks.
Converting Map Styles
I'm currently making a 2D rpg using DX7 Fullscreen DD. I have my current map system where each map is a screen big and when users hit the edge it moves them to a new map. I want to know how to go from this poor method to having larger Areas that are scrolling. When I say areas, I mean I dont want the whole world to be one map, I can split it up into a bunch of areas. I just want each area to be bigger than 1 screen size.
Alright, I've repeated myself enough.
So how would I save/load a map larger than the screen size? How do I tell it to blt only a certain section of the map?
PS: I'd also like to point out that this game is tile-based so using one fat picture won't do. 32x32 are the tile dimensions.
Thanks in advance,
Many Copys Of My Styles
I have the following problem:
I have a macro in MS Excel that opens a Word-file and adds some subdocuments. I'm using this command:
It works pretty good, except I have a lot of copys for every Style after that. For exemple:
When I open the Masterdocument myself and add the subdocuments manually a popup appears that askes me to rename the styles of the subdocument. When I answer "No" everything's fine. But I didn't find any attribute that could tell Word to not rename the styles.
Thanks a lot
Are there any alternative button styles available for VB??
Cell Styles In Vba?
I can get the style of a cell in vba, btu if one cell contains multiple styles (bold etc) and multiple colors, is there a way to get these per character?
This one's really stumped me big time.
Ok, cmdButtons right? They look 3D. But in some programs, (eg Internet Explorer) the toolbar is not 3D until you put your mouse over the buttons; then when you move your mouse out again, they go back to flat.
How do I do this????
"Dammit Smithers, this is brain surgery not rocket science!! Now hand me that ice cream scoop..."
XP Styles And Frame
I made my program have xp styles on it with a manifest file.
Now my frames are shown differently ( as expected ), but no matter what i do I can't change the forecolor of the frame anymore.. It's always kinda blue
what can i do to make it white or something??
A silly question probably but still asking..............
I have come across many posts in this forum which tell how to incorporate XP styles in a VB app. What I want to know is do those codes render the XP styles to a VB app when the app is run in WindowsXP only? If the app is run in some other OSs like Win2K or Win98 SE, won't the app render the XP styles using that code?
Problem With XP Styles
Ok I have an application in VB6 and i am trying to apply XP styles to the app. The styles apply fine, but when there is a button on a frame it draws a black box around the button. Also with checkboxes or radio buttons on frames they caption just shows up as a blacked out box. Is there any way to correct this or is the only solution to take them off of frames? Any help would be appreciated. thanks.