Help On Caption Events
I am running a series of "IF" and "Then" statements. I am having a ComboBox List of names that if the combobox = "milk " then
lbl1.caption = "icecream"
Though I want to run a second event that will always check what is in lbl1.caption without having a command button to check it. So... something like...
if lbl1.caption = "icecream" then
lbl7.caption = "yum"
BUT I put the above code in and lbl7 caption does not change...though if I make a command button to do this effect it works just fine, but I don't want to use a button.
Any help at all would be great!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Form Caption Mouse Events (WM_NCLBUTTONUP)
I'm trying to detect mouse down and up events in a Form's caption area by subclassing the form's window.
On my laptop (XP home), I get WM_NCLBUTTONDOWN but not WM_NCLBUTTONUP messages
The same for right-clicks as well ... anybody know what's going on???
I'll post a short demo - maybe it's just XP home??
Keep Form Caption ...but Change Taskbar Caption...how?
I want to keep the Form caption as is...but kind of need that the button in the TaskBar shows the percentage of completion of a task... since it'll be sometimes working in the background
this is just like it happends in the application FlashFXP ...in the main it shows the app.caption and the FTP where I'm logged and in the TaskBar it shows the percentage of the file being retrieved and total time to finish...
I just need to find out the ...How to do it... been searching here in general and in the API section but all (that I've found) reffers to borderless or without titlebar forms ...
Thanks in advance for any lead provided!
Can You React To Events Using APIs Similarly To VB6 Form Events, Etc
Please excuse this question if it is laughably ignorant. I am having trouble trapping the Tab key on a VB6 form. Since all of the controls have their own hwnds, I was wondering if there was anything I could do with an API and child windows to determine when it changed.
I have worked with APIs only a very little bit, so please bear with me on this one if possible. Thanks in advance!
Have a great day!
How To Handle Grid_click Events Vs Grid_mousedown Events
I'm new to Visual Basic, but have done event-driven programming before, using a different IDE.
I'm maintaining a program running under Win 98, that is using a msFlexGrid control.
When the user left-clicks on a cell, I want specific actions to be taken, depending on the cell. I've got this part working just the way I want it.
However, I've discovered that If the user right-clicks on a cell, something undesireable happens.
All of the processing for the desired events (left clicks) are handled in grid_click().
I need to detect if the right mouse button is being pressed, and ignore them.
I've decided to create a breakpoint in grid_MouseDown(), to see if grid_MouseDown() was called before grid_click(), since grid_click is always called, regardless of the right or left button is pressed.
When I set a breakpoint in grid_MouseDown(), the breakpoint in grid_click() never occurs, and vice-versa.
I know I have some fundamental mis-conceptions about event handling, but I don't know what.
Would someone please help me out ?
Events Container / Wildcard For Events
Is there a possibility to assign events from _different_
controls to a container and to distinuish between them?
Can you use wildcards for events like
private sub GS*_Click()
Events (click Events)
Hello and Thanks in advance for any asistance
Is there a way to get the name of the control that fired off an event in VB?
I have a form with 100+ buttons, if button # 89 was pressed I'd like to know that it was Button # 89 by writing button # 89 into a text field. I'd like to do this from one function and with one set of code rather than 100 copies of the same code, for each button.
Have an ocx made which is more or less a Label (in vb)
What I would like to do is to resize the label depending on the font chosen
Is there a way to define the height of my label depending on the font used
a bit like in a text box if you try to make the text box smaller than the font
chosen it wont allow you
I need to know how to make the caption in form2 the same as another label in form1.
I'd imagine it would be something like:
but that doesn't seem to work. Thanks.
Hello to all,
How do you center the caption text of any form. I hate adding spaces to manually center the text. Is there another way of doing this.
thanks a bunch.
When trying to set the caption after loading a form the form load event is executed a second time. The form is being called by a class. If I call the form from outside the class a second form load event does not occur. If I set the caption within the class module a second form load does not occur. Is there a way to set the caption from within the form?
When I use the following code in a command_click event on another form it doesn't change the caption of the main form:
If strFile = "title.dat" Then
frmMain.Caption = Text1.Text
ElseIf strFile = "nick.dat" Then
Nick = Text1.Text
Re Caption Bar
hi all...thanks for the info.i will delve into the attached code in due course.is there any reason why microsoft would not add this featurs to the toolbox controls.is it available in ver 7.
there must be zillions of undocumented tricks thats waiting to be discovered....
thanks again for all the replies...
yes please post the newer code for me.
You see a snapshot of Windows(R) Media Player 10.0.
Is it possible to add a button to the control box of form like the one in picture in VB 6.0?
If yes, how this should be done?
In a form with ControlBox = False and Caption = "" how may I show a text in taskbar as caption?
Note that I don't wanna have an actual caption on the form to avoid having caption bar.
Use Anything That Has .caption
Hello, I was wondering, I have a function and I want the user to enter a control they have (label, form, commandbutton, anything that can do .caption). But I don't know how I can do this...
Option Explicit Dim i As IntegerDim Start As LongDim EndT As LongDim Total As DoubleDim DoTime As Integer Declare Function GetTickCount Lib "kernel32" () As Long Public Function TimerStart(Optional Lbl As Label, _Optional Cmd As CommandButton, _Optional Frm As Form) As Long i = i + 1 If i = 1 Then Start = GetTickCount End If EndT = GetTickCount Total = (EndT - Start) / 1000 Cmd.Caption = Total Lbl.Caption = Total Frm.Caption = Total End Function Public Function TimerReset() i = 0End Function
Basically my question is.. how can I get cmd.caption=total, lbl.caption=total etc. into just one. Example: obj.caption=total. Thanks.
I wasn't quiet sure how to ask this, I hope it wasn't too confusing.
How To Get A Caption
How do you get the caption of the window with focus? I know how to get the caption.. but how do I get the handle of the window with focus?
A VB6 Form has a TextBox & a ListView. Each of these controls have a corresponding Label. This Form also has a CommandButton. When the CommandButton is clicked, all the items in the ListView get deleted. Here's the layout of the Form (the Captions of the 2 Labels are red colored):
'here comes the TextBox
'here comes the ListView
NOTE THE SHORTCUT KEYS (S & W) FOR THE 2 LABELS WHICH ARE UNDERLINED.
Assume that the ListView is not empty. What I find strange is if I press Alt+S or Alt+W from the keyboard, then all the items in the ListView get deleted! On the other hand, if the ListView is empty, then pressing Alt+S or Alt+W unloads the Form.
If I am not mistaken, Alt+S & Alt+W should set the focus on the TextBox & the ListView respectively, isn't it? So why is this happening? How do I overcome this?
Note that the shortcut key of the CommandButton is M i.e. the Caption of the CommandButton is Remove All. So when Alt+M is pressed, the CommandButton gets activated & all the items in the ListView get deleted.
Need help. Trying to place a up arrow on 1 cmd button and a down on another cmd button. This is so i can make a lable were the number will increase or decrease on click of the cmd.
How To Set Caption... ?
I have a form, where i have set the controlbox to off, and the ShowInTaskbar thingie on. What i want to do is being able to set a caption for the form, which is only visible in the taskbar, thereby making the controlbox remain invisible. Does anyone know how to do this ??
How do you put a caption under the programs name when it is an exe file.Like some progs have the name of it then say "Microsoft" underneath it.How do you get a name under there?Thx yall I appreciate it
I would like to give the caption bar at the top of a form a title, but at the same time i do not want it to be visible.
Does anyone know a way of doing this?
Thanks in advance
Get IE Caption
Anyone know how to get the title bar caption in Internet Explorer. I don't want to change it, I know how to do that. I just want to be able to get it in a text box whether it be the roiginal or a customized one.
'&&' In Caption?
Really quick, stupid question. Is there any way to get the '&' character to appear in a menu or button caption, ie without causing the underline?
well how can i change the caption of a form or a lable so that the last caption is still there until i want it .
How many characters can be in the caption or title section of a form? On one of my forms the caption is not being displayed. Is it too long? Thanks for your help.
'&&' In Caption
Could someone possibly tell me how to display an ampersand in a form / label's caption?
I don't want to create a hotkey.....just display the '&'
I'm not sure if this is a simple or complicated question (thin line with my questions). I want to right justify the number caption in my ADO Record Bar control. This is a standard in MS Access, but I'm unsure how to do it in VB or VBA code. I'm sure someone out there has done it. Can you help? Thanks, DAVE
i'm trying to make a program that will calculate the volume and surface area of a sphere based on the radius (which the user inputs), and i'm running into an error. here's the code i'm using for the button:
Code:Private Sub btnCalc_Click()
pi = 22 / 7
r = Val(txtRad.Text)
v = (4 / 3) * (pi * r * r * r)
sa = 4 * (pi * r * r)
lblVol.Caption = Str$(v)
lblSurArea.Caption = Str$(sa)
i uploaded a zip of all the vb files for the program here:
please help! thanks.
Edited by - iamthejake2000 on 12/16/2004 11:26:32 AM
MSG Box Caption
When i make a msg box i was wondering how i make the header say for example "luke" instead of project 1 c
Anyone help please
i don't understand the method caption
Private Sub cmdExecReport1_Click()
' -- Set the report variables
g_szReportName = cmdExecReport1.Caption
g_szReportFile = "rptExecReport1"
if u have an idea...
Minimising Without A Caption
*** I have found the cause of the problem - I have an invisible menu so that I can have pop-up menus in the form - this makes the border/caption bar visible unless the caption = "" - if anyone knows how to change this, it would be much appreciated. Thanks ***
Here goes my first post here!
I have made a full screen application (without caption bar) that covers the taskbar - this is all very nice until someone wants to minimise the form. I have made a command box with frmForm.windowstate = vbMinimized, which works fine, except there is naturally no caption in the taskbar (i.e. I just get the application icon with a blank space).
To solve this, the line before the windowstate line, I have added frmForm.caption = "xxxxxxx'.
However, when I come back to the form, there is a horrible caption bar! I have attempted to find some solutions by seeing if adding frmForm.caption = "" to a random command box (would capture events if it works), but that shifts the whole screen up, so the taskbar and some space above that is visible.
As the form is maximised, I can't then go and change the form's size.
Does anyone know how to make the caption appear in the taskbar, and to return to a fully maximised screen with no caption bar?
Thanks in advance,
Hi, not sure if this is the best forum to put this in, but I was wondering if it is possible to change the vertical allignment of the caption on a label. The reason I ask is that I have a coloured background on it, and the text seems too close to the top of the box.
How Do I Get The Caption Of A Frame ...
... of a Control which is containd by it.
I got an array of UserControls and an array of Frames which contain one or more of these UserControls. When I get an event from my UserControl, I want to get the Caption of the containing frame.
Can someone help me?
Does anyone know how to bring a label.caption to the front. It does not show above a Picturebox - I would prefer not to use a container as this will screw up all my calcs!!!!
I just can't figure it - tried SetWindowPos but labels do not have an hwnd!!
Thanks for any help!
Add Buttons To Caption Bar?
hey...again, thanx for all the help so far.I was just wondering if it was possible to add buttons to the top bar in visual basic 6. If it is could you tell how to do it?
On a form in Access 2000, is there a way to center or right align the caption:
Me.caption = "Title of the Application " & Me.OpenArgs
I am going to increase the number of a label, which code is better to use ?
For I = 1 To 10
lblTotal.Caption = Val(lblTotal.Caption) + 1
For I = 1 To 10
Val(lblTotal.Caption) = Val(lblTotal.Caption) + 1
Set Frame Caption From Db
can anyone help.
I have a program that has a form in it, this uses about 20 frames.
Each of these needs a question as the caption which is held in an sql database.
The code i have written does not work but it may give you an indication of what i want.
Do i need to dim something as a frame or an object or a ????
My frames are named 'fra1', 'fra2', 'fra2_2'.
and the question_Number is 1, 2, 2_2 etc.
'get question data
sql$ = "SELECT * From Tri_Question"
SQLRecs.Open sql$, cn, adOpenStatic
Do Until .EOF
oframe = "fra" & !Question_Number
oframe.Caption = "Question " & !Question_Number & " - " & !Description
Thanks in advance