My Form Wasnt Showing Title Bar, But When I Added Menu Title Bar Reappeared....
I set the border to 0 and controlbox to false so that there is no title bar. Now I want to keep it that way but when I added the menus to the menu editor, the title bar reappeared although I set the menu visible to false. The menu is not showing on the top but the title bar reappeared which I dont want. I want to use the menu on right click on a treeview and therefore I cannot do without it.
Is there any way I can have the menu and no title bar? I dont want to show the menu but I will be using it on right click.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Showing/Hiding Form Title Bar
I believe I have a simple question. I wish to have a form which displays a Title Bar (Control box) when it is a normal window, but then does not show the Title Bar when it is a full screen window.
I'm using VB6.
I'm able to create the full screen window by setting the following properties of the form
BorderStyle = 0
ControlBox = False
WindowState = Maximized
From what I've read, it seemed like I could set ControlBox = True as long as BorderStyle = 0 and I would not see the title bar. However, this does not seem to be the case.
As soon as I change ControlBox = True, the title always appears.
What am I missing?
Thanks
Heavily Modified VB6 Form (title Bar, Moving, System Menu, ...)
I am currently working on a form in Visual Basic 6 that can do the following:Have no title bar, but appear in the taskbar, including icon.Can be moved around by clicking and dragging any portion of the form.Has a system menu, with minimize, restore and close functions working.Has no border.Has a minimize and a close button on the form.I have read postings in this forum extensively, and found solutions to all of these single tasks. One solution even included an invisible proxy window. The proxy window has the problem that the form cannot be minimized correctly (must be minimized twice).
So now, I am trying to solve it all in one VB6 form, without a proxy window, but using subclassing if needed.
The following code works, but it cannot do all at once (see comment in code, either system menu or moving is possible). Also, it gets a small border which i don't want.
To enable the system menu, I may have to use subclassing, right?
Code:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 0 'Kein
Caption = "TestForm"
ClientHeight = 2496
ClientLeft = 0
ClientTop = 0
ClientWidth = 3744
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2496
ScaleWidth = 3744
StartUpPosition = 3 'Windows-Standard
Begin VB.CommandButton cmdQuit
Caption = "&Quit"
Height = 372
Left = 1200
TabIndex = 1
Top = 1680
Width = 1212
End
Begin VB.CommandButton cmdMinimize
Caption = "&Minimize"
Height = 372
Left = 1200
TabIndex = 0
Top = 1200
Width = 1212
End
Begin VB.Label Label1
Caption = "Click anywhere in the form to move this window"
Height = 492
Left = 720
TabIndex = 2
Top = 360
Width = 1932
WordWrap = -1 'True
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd&, ByVal nIndex&) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd&, ByVal nIndex&, ByVal dwNewLong&) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd&, ByVal bRevert&) As Long
Private Declare Function DeleteMenu Lib "user32" _
(ByVal hMenu&, ByVal nPosition&, ByVal wFlags&) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "user32" ()
Private Const WS_SYSMENU = &H80000
Private Const WS_DLGFRAME = &H400000
Private Const WS_CAPTION = &HC00000 ' WS_BORDER Or WS_DLGFRAME
Private Const GWL_STYLE = (-16)
Private Const GWL_WNDPROC = (-4)
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Private Const SC_MOVE As Long = &HF010&
Private Const SC_SIZE As Long = &HF000&
Private Const SC_MAXIMIZE As Long = &HF030&
Private Const MF_BYCOMMAND As Long = &H0&
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Private Sub cmdMinimize_Click()
Me.WindowState = vbMinimized
End Sub
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SYSMENU Or WS_DLGFRAME
' ====================
' The following line can be commented out to make the move feature work,
' but then the form no longer has a system menu.
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
' ====================
SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_FRAMECHANGED
' SWP_NOMOVE = Ignore x and y parameters (retain position)
' SWP_NOSIZE = Ignore cx and cy parameters (retain size)
' SWP_NOZORDER = Retain Z order
Dim hSysMenu As Long
hSysMenu = GetSystemMenu(Me.hwnd, False)
Call DeleteMenu(hSysMenu, SC_MOVE, MF_BYCOMMAND)
Call DeleteMenu(hSysMenu, SC_SIZE, MF_BYCOMMAND)
Call DeleteMenu(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngRetValue As Long
If Button = vbLeftButton Then
Call ReleaseCapture
lngRetValue = SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End If
End Sub
The code consists only of this form.
Any hints or help would be greatly appreciated! I am quite confused because I don't see why the features can't work together.
Thanks folks!
Title Bar And Showing Current Date
Welcom
How to make
I want show an Title Bar such text, which showing todey’s date, for example
Todey is Thursday ****** 2006- March -02 ****** The nice days.
Many thanks for all
Help...Find First Title And Loop Its Own Lines Before Another Title In A Text File
Hello all VB Guru,
I've done as the following codes:
Code:
Open "C:Test.txt" as Input #iFile
Do While Not EOF(#iFile)
Line Input #iFile, MyString
Debug.Print My String
Loop
Close #iFile
But it will only show all lines in immediate window.
'Text file Start from Here
Code:
Apple
Category Fruit
Item-Code ABC-123
Item-Identifier ABC-123
Skey Red
Random-Price 0.80 1.00 1.50
Random-Weight 0.20 0.22 0.25
Cucumber
Category Vegetable
Item-Code ZEG-567
Item-Identifier ZEG-567
Skey Green
Random-Price 0.50 0.70 0.90
Random-Weight 0.30 0.42 0.56
Orange
Category Fruit
Item-Code KXT-789
Item-Identifier KXT-789
Skey Orange
Random-Price 0.70 0.90 1.00
Random-Weight 0.25 0.33 0.48
'Text File End at Here
I wonder it is possible to come out a loop that will detect the first title "Apple", get its own information from "Category" to "Random-Weight", then stop there and show in every textbox before continue to detect another title "Cucumber" with its own information that will show in every previous textbox (the loop will run over and over again until the last title)?
Thanks in advance,
Juan
Showing The Minimize And Maximize Button On The Title Bar?
Now now now.....I've a form whereby I set the border style property to Fixed Dialog. Now, after setting this style, there doesn't seem to be any Minimize or Maximize buttons on the form's title bar.
Is there a way to show this? Thanks a lot!
Different Size For Big Title And Columns Title In DBGrid
Is't possible to put a different size for my general title and columns title in DBGRid
With HeadFont I can put a new size for my big title but the title for each columns take the same size.
How can I put size 12 for big title and size 8 for columns title.
Thanks
Redg
Menu, But No Title Bar.
I want a form that has a border style of none. so no title bar. but I want some hidden menus for popup. but every time I try to add them to a form I get a title bar. even if there is no menu ber, and the borderstyle is set to none. does any one know how I can get this to work?
Requesting <title></title> Text
Hello All,
I have a programme that has a browser window in it.
What I want to do is extact what is between the <title></title> tags and set it as the current Caption of the Parent Form. What I also want it to do, is to automatically update when ever the page is reloaded, or just when ever the title of the Browser page changes.
Thanks
- Luke
Popup Menu's W/o A Title Bar
How can you have a form with popup menu's, but no menu bar and no title bar? I set the border style to 0, but when I put in the menu, I get back a title bar. Any way to disable this?
Menu And Title Rows
Is there a method for finding the height of the menu and title rows on a form.
When a user increases the font size it makes the form unusable. I'd like to be able to increase the height of the form based on the height of the menu and title rows.
Remove Title Bar But Keep Menu
Is it possible to remove the title bar of a form but keep the menu with the File, Edit, etc. stuff is? I also want to keep the form in the taskbar with a caption.
Displaying A Title, But Using 2nd Value From A Drop-down Menu
Hi All
Sorry for the confusing subject, but I'm hoping that you will be able to
help.
In very basic terms I want to emulate a <SELECT> HTML box in VB.
All I want to do is display a title name in the drop-down list, but the
actual value I use would be something else.
For example, in HTML I would simply enter:
<OPTION VALUE="fred">Mr Fred Smith</OPTION>
<OPTION VALUE="bill">Mr Bill Smith</OPTION>
<OPTION VALUE="bob">Mr Bob Smith</OPTION>
And when the user selected one of the above display names I could then
simply take the value (eg, bill) and work with that.
In VB you only seem to be able to have 1 value for displaying and using.
Is there a way round this?
Rgds
Laphan
How To Show/hide Title And Menu Bar?
Anybody can tell me how to show/hide the titlebar & menu bar? i know how to hide menu bar, but when i has a menu bar in the form, no mater show or hide, when i set the boder property to no boder, there is always a title bar shown,
so what should i do? thanx very much
Show/hide Title Bar With Menu
When I set the BorderStyle property of my form to "None", the titlebar and the menu is still there. How can I hide the title bar and the menu easily in VB 6? Thanks in advance.
Adding An Item To Default Context Menu For R/click On App Title Bar
How do I add an item to the default context menu of a Window(s).. The right click on an app title bar or Task bar icon.. (Restore, Move, Size, Minimize, Maximize, Close)
I want to add a few things to it like 'OnTop' and 'Hide' and a few other things.. I can do everything but the adding to the context menu.
Form Without A Title Bar
I have made a form without a title bar but now it is not visible in the start menu / task bar.. how can i add it.
Form Title
Trying to do something like...
VB Code:
Private Sub Form_Load() Form1.Name = Text1.Text End Sub
Unfortuneatly I can't get this to work. Any Ideas?
No Form Title Bar?
Ok heres my dilema,
i dont want the defualt title bar, so i set form.borderstyle to 0
also clipcontrols 0, control box 0, minbutton 0, maxbutton 0
its works fine and all, then i added a menu(hidden) but then the title bar re-appeard, so i made the title of my app "" <-nothing so then it went away? which is great, but now my app has a small black border like if it were to have a fixed single border, and i dont want that!!!!! thats what i want to get rid of but i have to have my menu, and have my title bar hidden
Moving A Form Without A Title Bar
Currently I'm using the mousedown, mouseup, and mousemove events to see when someone is dragging the form by its body. It has a background image with a "title bar" to drag it by. The problem is that when you move the form it leaves a trail and the window doesnt keep up with the cursor. I tried using the movewindow API instead but the same thing happens (if I use redraw=0 with movewindow and then redraw the form on mouseup, the textboxes disappear). The window moves smoothly if it has a regular title bar to drag it by. How is this accomplished?
Fat XP Form Title Bar Causes Problems
I just began working in Windows XP Pro. I found that some of my VB applications, developed in Windows 98 looked a bit distorted in XP. The thicker title bar on the windows (forms) has caused some controls at the very bottom of the form to get clipped, as if the thicker top bar has assumed some of the available space and pushed everything else down. It's as if I'd have to increase the Height of each form a wee bit to show everything.
I can imagine some ad-hoc fixes, but would appreciate any suggestions to handle this systematically. Should I peg every control to frmXxxx.Top?
Moving A Form Without A Title Bar
Normally when you drag a window, you drag it by the title bar. I'm trying to make my window drag when you click and drag the forms background. I have this:
Code:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Dragging Then
Me.Move Me.Left + X - OldX, Me.Top + Y - OldY, Me.Width, Me.Height
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dragging = False
End Sub
That moves the form alright, but it moves kind of slow because the form is large. I was trying to make it move in 2 or 3 pixel increments, but I couldn't figure it out.
Form Drag Without Title Bar
how can i make the form drag around the screen when the form is clicked and dragged from any point of it?
thanks!!!!
How To Remove The Title Bar Of MDI Form In VB
Hi..
Iam a student, currently iam doing a project in VB 6. I want
to remove the title bar of MDI form !!!.. is there any
possibilities? can any one give me the API command or any
source to remove the title bar of MDI form.. not MDI child
Moving A Form Without Using The Title Bar
I am trying to move a form that has a none border style, it has no title bar. I made a shape that I want the user to be able to hold down the mouse and it works jsut like the title bar would. I tried using the mouse down and mouse up, I would record the original mouse placement, and then compare it to the mouse up position. then try to move the form accordingly, but I always end up getting it way farther than the mouse went, is there a ratio that I need to divide the change by to make it work right? or is ther another way to move my form?
Form Title Bar Size
Was doing some simple collision detecting as a basis for another project and created a simple shape bouncing around inside the frame using
Code:
Private Sub Timer1_Timer()
Shape1.Left = Shape1.Left + xMove
Shape1.Top = Shape1.Top + yMove
If Shape1.Left + Shape1.Width >= Form1.Width Or Shape1.Left <= 0 Then xMove = -xMove
If Shape1.Top + Shape1.Height >= Form1.Height Or Shape1.Top <= 0 Then yMove = -yMove
End Sub
and noticed the ball wasn't reacting properly at the bottom of the screen, a few little tests later i realised that the problem is that a forms .height includes the size of the title bar but the .top value starts just beneath it and so that ball wouldn't respond until it was the width of the titlebar beneath the bottom of the form, I was just wondering on the best way to compensate for this, is the height of the bar constant, or is there another value that diregards the bar's height?
I don't want to use a borderless form, and i dont want to set a constant form height
Resizing Form With No Title Bar
hi There,
I've hit into a small but potential snag.
I want to have my form/s window less, this is no problem but when you set this you cannot resize the form by dragging it, as you would in the normal way.
How can i do this with the API etc.
the pig..
Title Bar Colours On MDI Form
VB6
Hi there, I hope that someone can help me out with this one.
I'm creating a MDI application, where I have inserted another application into a child form by use of the setparent call.(Child on Child on MDI)
This works fine, but when i click the inserted application on the child form, the titlebar of the MDI form turns grey.
It looks like the setparent call doesn't make it a true child.
What can I do to make it a true child, meaning that the MDI form titlebar changes colour together with activation of the inserted application?
Setting Form Box Title
When I set form box name it dosnt show the name.
For instance:
Server Display shows: Form 1
Search Displays : Form 2
How can i set these headers?
Remove Title Bar Off Of Form Using API's
I just want to remove the titlebar of a form using API's, yet still be able to keep the black boarder around the form. Setting the Borderstyle to 0 - None removes both, and I don't want that. Any ideas on how I can pull this off?
Add A Icon To A Vb Form Without Title Bar
hi,everyone
i have a question:
a new vb project in vb6.0,and add a form,set controlbox to 0,caption to nullstring, so the form's title bar is disappear,but at same time,the form's icon is disappear too.i don't like this.
how can i do:add a icon to a form without title bar?
thank all!
Disabling Title Bar Of The Form
i have created one form in VB with miximised property state. it should be miximised all the time.
now about the problem, when user double click on restore button or double click on the title bar of the form, the form get restore to its original position. i even try to put code in resize even of the form to again mizimise it. but its not look professional.
i have removed restore menu item from the control menu. but i didnt able to disable double click event on the title bar of the form.
one way i suppose, that one can diable double click event of the form by api programming or sub classing.
can any one help me in this regard??
thanx in advance.
firoz
How To Drag A Form Without A Title Bar?
Hi! I am developing an application that uses a form without a title bar, borders etc. I Need to create the dragging functionality myself but there does not seem to be an event for MouseDrag. I would need to capture the X and Y coordinates of the mouse when it is dragged in order to position the form at these coordinates.
Can somebody please suggest a way in which I could do this?
Thank You
How To Resize A Form That Has No Title Bar
Hi folks, i hope someone of you can halp me out.
I'm actually trying to create a custom title bar without using the default windows title bar. That worked fine, no question about that, but in order to remove the default title bar first you normally have to chose "none" as the borderstyle of the form, (or is there any other possibility?).
But when I do that i can't resize the form anymore. So how can I remove the titlebar without destroying the resize option?
-if there's no poswsibility I would program a resize event, but that's very hard (would probably need to find out the cursor position on the screen but i reckon this would need a timer and that's not the best way cos it's not that kind of good and real proggramming think.
thanx a lot
Align Form Title
How do you align the caption of the form on the title bar to the right rather the left?
When Clicking 'X' In Title Bar Of MDI Form
Causes VB.exe to crash.
All i have is code in the QueryUnload of the MDI which works fine when i walk thru in debug mode. Again if i add a Msgbox to see were i get to in case it crashes, it works okay. So what possibly is causing Vb to crash? Please any help appreciated.
Exact Error is...
Exception access violation(0x0000005),Address 0x00431257
The Event Viewer log(NT)...
The Open Procedure for service "McShield" in DLL "dssdata.dll" failed. Performance data for this service will not be available.
Status code returned is DWORD 0.
COULD THIS BE A McAFEE APPLICATION BUG???
[Edited by drichmond on 03-29-2000 at 02:04 AM]
How To Put An Picture On Form's Title Bar
I've been searching for so long but couldn't find out HOW to PUT an PICTURE on Form's Title bar with APIs function.
Does any one know the code or the solution for it ? Please show me whatever you know to make it !
Thanks
Moving Non-Title Form
I want to create non-title form. It allows user to move the form by hold down the left button of mouse on the form while moving the mouse across the desktop.
I have done this task with two mouse's events: MouseMove & LButtonDown
Private Sub Form_MouseDown()
'Note down the current p_Top, p_Left of the form and
'current p_xPos, p_yPos of mouse pointer
End Sub
Private Sub Form_MouseMove()
'If the left button is press then:
'Get current xPos, yPos of mouse pinter
'Calculate next Top and Left to move the form to:
' Top = p_Top + (yPos - p_yPos)
' Left = p_Left + (xPos - p_xPos)
' Move the form to new (Top, Left)
End Sub
-------------------------------
Problem:
The form is flicking, flashing because it changes Top, Left co-ordinates frequently
Does anyone can help me to solve to proplem
Thanks very much
TDH
Pls. see attachment for the project I have done.
EDIT by johnminkjan moved to VB general board
Edited by - johnminkjan on 6/12/2005 12:56:31 AM
|