Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




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??

Getting Form1.caption And Modifying It To Display On Label1.caption
Hi,

If my form1 has a caption of "Hello World [xxxxx]", (where xxxxx could be any value) then on Form_Load, label1 would equal xxxxx
How would I do this?

Thank you,

-John

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!

Showing Caption For Taskbar When I Need The Caption To Be Null
I have a custom made gui form and it's also resizable, the following properties are attached to this form: Controlbox = true, caption = "", and borderstyle = sizable. So would it be possible to show it in the taskbar with a caption?

Vb6 Exe Does Not Fire Events From Standalone Mode, But Fires Events When It Runs In Vb6ide
Hi all,
I have a problem in VB6. When i run the application from the vb6 ide, it works fine and gets the events from the COM dll it works with. However, when I make an exe of the application and run it no this exe does not receive any events from the COM dll. Any help greatly appreciated.
thanks
yetty

Can You React To Events Using APIs Similarly To VB6 Form Events, Etc
Hello,

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!

j2consulting@yahoo.com

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 ?

thanks

tony

Changing Taskbar-button Caption Without Changing Form Caption
Hi,

Is there any way to change the caption of the taskbar button, without changing the form's caption?

Thanks.

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

Code:
private sub GS*_Click()
?

How Do I Do This Form3.Label1.Caption = Form2.Label1.Caption
I have 3 forms in my project how do I send the Form3.Label1.Caption to Form2.Label1.Caption I try this and it not working
VB Code:
Private Sub Command12_Click()Form3.Label1.Caption = Form2.Label1.CaptionEnd Sub

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?

For example:
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.

Thanks again

Other Events {other Applications' Events}
Can I intercept events form other processes (like "explorer.exe") ???

Caption
Hi All
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
thanks

:/ About Me Caption Bar Bit
how would i use my own images for close and top bar i dotn want windows xp1 can some1 help
thnks.

Caption Help
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:

form1.label1.caption form2.label1.caption

but that doesn't seem to work. Thanks.

Caption
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.

Caption
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?

Caption
When I use the following code in a command_click event on another form it doesn't change the caption of the main form:
<pre>
If strFile = "title.dat" Then
frmMain.Caption = Text1.Text
ElseIf strFile = "nick.dat" Then
Nick = Text1.Text
End If
</pre>

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.

john

Caption Bar
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?
Thanks.

Caption
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...

Module:

vb Code:
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?

Alt+Key Caption!
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):

Enter Website:
'here comes the TextBox


Manage Website:
'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.

Thanks,

Arpan

Cmd Caption
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 ??

Cheers !

Caption
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

Getting The Caption Of Another App
Is such a thing possible in vb?
I'm confused thinking about it

Caption Bar
Hi,

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

Sarah

Getting The && In A Caption
How can I???

I know it's possible but i just forgot how to...

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?
Thanks.

Caption
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 .

Caption
Hi Everyone,

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.

&#039;&&&#039; 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 '&'

ADO Caption
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

No Caption???
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)
End Sub


i uploaded a zip of all the vb files for the program here:
http://www.geocities.com/iamthejake2000/sphere.zip

please help! thanks.



Edited by - iamthejake2000 on 12/16/2004 11:26:32 AM

MSG Box Caption
Hi,

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

Caption With && In It
How do yu set a caption to reflect 'A & B' ?

Caption???
i don't understand the method caption

for example:

Private Sub cmdExecReport1_Click()

' -- Set the report variables
g_szReportName = cmdExecReport1.Caption
g_szReportFile = "rptExecReport1"
DoCmd.OpenForm "frmReportOptions"

End Sub

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,
Ed

Caption Allignment
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?

Thx, X-Ray

Caption ZOrders
Hi everyone!

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?

Caption Align
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

???

Thanks

Label.Caption
I am going to increase the number of a label, which code is better to use ?

Code:
For I = 1 To 10
lblTotal.Caption = Val(lblTotal.Caption) + 1
Next I

Code:
For I = 1 To 10
Val(lblTotal.Caption) = Val(lblTotal.Caption) + 1
Next I
Thanks.

Set Frame Caption From Db
hi,

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.


Code:
'get question data
sql$ = "SELECT * From Tri_Question"
SQLRecs.Open sql$, cn, adOpenStatic
With SQLRecs
Do Until .EOF
oframe = "fra" & !Question_Number
oframe.Caption = "Question " & !Question_Number & " - " & !Description
.MoveNext
Loop
.Close
End With
Thanks in advance

Ian.

Please Help Me!How To I Get The Field Caption
Hi ,
How I can get the captions of fields in the ms access table in VB6?Like
field("Field1").caption in ADO
Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved