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

Label Refresh Prob....

It's seems like I've had this kind of problem for a million years, so I'm going to ask.

Often when looping through a database, I will be refreshing a label control as to what is going on. Example: "Processing record 5035 or 6000" or whatever. At some point, and it's totally random, Windows will stop refreshing the control. It happens on any machine, either compiled or in the design environment.

Anyone have this? I'm tried all sorts of ways to stop it, but it doesn't work. Thanks.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
FileListBox Refresh Path Prob
here's a strange one...
I'm use the FileSystemObject thingy to delete files from a directory.
Works great.
However, I can't get a FileListBox to then refresh the list items of that continues to show files that have been successfully deleted. I've tried calling Form1_Load..which has the File1.Path = "c:/myfolder" .......tried calling File1.Path = "c:/myfolder" ...even tried using the timer as a delay in case there's a lag in deleting a file.


Function To Move Form By Label - (W98 Ok , W2k Prob) *Resolved*
Hey VbCitizens, i got a problem with a function that works on Win98 but not on Win2k, can someone tell me if i need another declaration to get it working on both, or do i need to add a certain dll only found on Win98 orso?
I don't get any errors using it on Win2k, but it just doesn't want to move..., so i don't know what am looking for here.

Thanks at front.

Private Declare Function ReleaseCapture Lib "user32" () 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 Const WM_SYSCOMMAND = &H112

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
       SendMessage Me.hwnd, WM_SYSCOMMAND, &HF012, 0
    End If
End Sub

aka Red2048.

Edited by - T48 - [RedPlanet] on 3/2/2004 8:14:04 AM

Automatically Refresh A Label
i have a label on my visual basic program that is supposed to show the elapsed time of a stopwatch program i made but it only shows the time after i hit the stop button i made! Is there any way to have the label be updated with the elapsed time in realtime (so i can wacth the time go up)?

thanks in advance

Refresh Label Captions
after a form has been loaded can you refresh a caption from a textbox on a differnt form?

Refresh Label When Value In Registry Changes

I've made a simple program that can read certain values from a registry-key. However, I must click a button to read these values. Is there a way that my programm continously monitors this registry-key and updates my label when the value changes?

For short: When I change a value with regedit, my label must change also without me pushing a button. I know I can use a timer, but that's much to easy!

Thanks in advance.

Label Control Refresh Problem
I have a problem with the screen refresh (paint, redraw .. not sure of the most appropriate term) of 2 labels, one of which overlaps the other. Basically I am using what I will call label 1 as a rectangle with no caption (to get the click event which the shape lacks). Label 1 has an opague background. I change the color of the background color based on the state of an integer variable. But for now lets say that label 1 is always set to a Dark Grey Background. (By the way, all of the controls mentioned exist within a frame control) Now I have a second label, label 2, which has a caption of 1 character from the symbol font. The background of label 2 is set to transparent. At design time label 2 is on top of label 1, overlaping approximately 25% of label 1's area. At run time I change the .left position of label 2, either moving it closer to label 1, or further from label 1, to create an animation. I change write the .background color of label 1, and the .left position of label 2 every 500mS. My problem is this: Only when label 1 is dark grey, I will sometimes see a light grey background of label 2 where it overlaps label 1 during the 500mS screen refresh. This does not happen EVERY refresh, but consistently occurs during SOME refreshes. I have tried changing the Autoredraw and ClipControls property for the form in all combinations with no luck. And this ONLY seems to happen when label 1 is dark grey, not any other color. Can someone point me in the right direction??

Thanks in advance,


Label Doesnt Refresh When Changes Are Made
on my program on the 2nd form when you choose an option from a dropdown menu information appears in a label then on the next page the name of the option is suppose to appear in another label which it does but when you go back to the 2nd form and change the option and go to the 3rd form it hasnt changed in the label

Refresh Label.caption(s) On Form
I am trying to update the caption property of some label controls on a form based on the input of an array from a file. I am using the Resize event of the Form to try to update the captions and it works when I actually resize the Form. I tried to use the Refresh method to update the captions but apparently that will not work as it does not call the Resize event. Can someone point me in the correct direction? Here is the code I am using in the Resize event:

Private Sub Form_Resize
Dim Count as Integer
For Count= 1 to 5
lblData(Count).Caption = JobData(Count) 'Global variable
Next Count

Thanks for the help.

Refresh Label Caption In Form (Excel)
I have a form with a Text Label and a Button. By pressing the button a process starts running. I have a Variable into the process that changes continuously, lets say from 1 to "n".

I want to refresh the Text Label in the form with the value of the variable each time it changes.

I tried TextLabel.Refresh but this function seams to be not included in Excel Visual Basic.

My Question is, Is there any .refresh method for VB in Excel I can use to refresh the label in the form while the process is running?

I tried Form.Repaint and it works but it refreshes everything in the form and it looks wierd.

Cannot Refresh Data Using Crystal Viewer Refresh Method
I am using crystal report 8.5 and Visual Basic 6.0

I get an error for this code.


error :

Method 'Refresh' of object 'IcrystalReportViewer' Failed

thank you ....

regards pragash...

MSFlexGrid Refresh Causes My Comboboxes To Refresh???
What in the heck is happening?? On a form I have 2 combo boxes, the first for suppliers and the second for contacts. The contacts is filled from the database after the supplier is chosen. On my Flexgrid, I have several pop-up forms/controls. When I open them (For instance the DateTimePicker) and select the date from my pop-up control, my screen flickers and my contact is blank again. The supplier stays like it was. I can't exactly paste the code for this, since I am at about 5,000 lines and counting on this Application.

Difference Between Label.fontbold And Label.font.bold
Does anyone know the difference between Label1.FontBold = True and Label1.Font.Bold = True?

Label Question - How Can I Edit A Label On The Form At Runtime?
I have seen where if you click on a label in a program, it lets you edit it right there just like on the desktop. Has anyone done this before? How would I do this?


Clicking Through Label (or Disabled Label Color)
I'm having some trouble with a game I'm working on. I have image boxes that change color when they are clicked. Each image box has a label over. As it is now, you have to avoid clicking on the label in order to change the color of the image box. If I disable the label, then you can't even see it because of the color. Seems as though there is no way to change the disabled color, right. I need the label to remain on top, with an invisible background after the image box color changes. Is there anyway I can tell the program to ignore the labels? Or any other ideas on how to do this? THANKS!

[VB6] Change Backstyle Of Label When Mouse Over Label
Hello everyone! I am using Microsoft Visual Basic 6. My project has a Form with a Label. How do I change the BackStyle of the Label from Transparent to Opaque when the mouse is over the Label and back from Opaque to Transparent when the mouse is not over the Label? My code follows...

VB Code:
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)    Label1.BackStyle = TransparentEnd Sub

That code changes the BackStyle of the Label from Transparent to Opaque when the mouse is over the Label, but does not change it back from Opaque to Transparent when the mouse is not over the label. How do I do this? Thank you!

Adding Of Label Numeric Label Caption Together
I have a label with a value of 00:00:06 (numeric)as the caption. Ihave another label with a numeric caption of 00:00:03. How do I add both captions together to get a result on a third label caption?. What is the formula I should use?

Thanks in advance


Adding Of Label Numeric Label Caption Together
I have a label with a value of 00:00:06 (numeric)as the caption. Ihave another label with a numeric caption of 00:00:03. How do I add both captions together to get a result on a third label caption?. What is the formula I should use?

Thanks in advance


How To Delete The Last Word From A Label And Transfer It To Another Label
my question is, I have 2 labels :label1 and label2 and a command button : remove
what I need is when i click Remove the last word in label1 will get deleted and that word be send to label2 . I don't know what to do please i need help!!

If Label Caption > Label Size
Good Day,

I want to code a function that determine if the Label Caption is bigger than the Label size. Then, I would reduce the font size at RunTime.
I don't want to use the autosize property.

Is there a way to know if the content of a label is bigger than the label size ?

Many Thanks

How To Give X-axis Label And Y-axis Label For Excel Chart?
iam doing an application in visual basic which is used to analyze the data.

my application needs the analyzed data to be exported to excel and automatically plot the chart using the excel object.

iam able to do like these.

iam able to give chart title also.

iam trying to give x-axis and y-axis labels automatically.but i didn't find any solution.

could any body tell me how to give x and y-axis labels through coding.

please help me..


Determine If Label Caption Width Is Greater Than Label Width
Is there anyway to add a check to deteremine if a caption of a label is longer than the label width, and if it is, omit the last few characters to make it fit and add "..."

Example: If "How are you doing?" doesn't fit in the label, it'll show "How are y..." instead.

How To Give X-axis Label And Y-axis Label For An Excel Chart?
iam doing an application in visual basic which is used to analyze the data.

my application needs the analyzed data to be exported to excel and automatically plot the chart using the excel object.

iam able to do like these.

iam able to give chart title also.

iam trying to give x-axis and y-axis labels automatically.but i didn't find any solution.

could any body tell me how to give x and y-axis labels through coding.

please help me..


Prob With This....
... when i insert value in txtbox 38 the realtive value not correctly write in the column (is possible to insert a value in this txtbox if the record is different to "PAGATO")

... the scroll bar not work correctly in effect, i must click twice on the arrow down, to select the first record(?)

tks for all "wizard"

sorry for the dimension of attchment.

okay heres my code:

Private Sub Command1_Click()
On Error Resume Next
List1.RemoveItem (List1.ListIndex)
List1.ListIndex = (List1.ListCount) - (1)
End Sub

Private Sub Command2_Click()
List1.AddItem (Text1.Text)
List1.ListIndex = (List1.ListCount) - (1)
End Sub

Private Sub Form_Load()
Label1.Caption = ("0 items")
End Sub

Private Sub List1_Click()
If List1.ListCount = (0) Then
Label1.Caption = ("0 items")
Label1.Caption = (List1.ListCount)
End If
End Sub

okay what this does is, when command2 is pressed, it will add text1.text to a listbox (list1).. well command1 will remove whatever is selected in list1.. well when i remove everything, label1 still says 1. label1 displays the number of items in the listbox.. my question is, how do i get label1 to say 0 when the listbox is empty? thanks for reading!

edited this... typo..

- turray

Another Prob
But there is another Problem:
When I loaded the Data in the String and saved the String to a temp file to put out the needed infos there is a " at the beginning and one at the End of the file. How can I avoid that?

Here is a example code:

Dim Text as String
Inet1.AccessType = icUseDefault
Text = OpenURL(")
Open "c: empMSsource.txt" For Output As #IntFile
Write #IntFile, Text
Close #IntFile

Greetz Doc

If i > 1 Then
RS.Open "Select * from Login where name='" & txtLoginN.Text & "' and pass='" & txtLoginPass.Text & "'", CON, adOpenKeyset, adLockOptimistic
If RS.RecordCount = 0 Then
MsgBox "InValid User & Password", vbCritical, "Failure"
MsgBox "Password Correct", vbInformation, "Success!"
Unload Me
End If
i = i - 1
MsgBox "InValid User & Password Unloading", vbCritical, "Failure"
End If

''Disable the Sumbit Button
cmdLogin.Enabled = False
cmdLogin.Caption = "Verifying...."
''If not Defined
If txtLoginN.Text = "" Then
MsgBox "Login Name Required", vbCritical, "ERROR"
''Restore the Values
cmdLogin.Enabled = True
cmdLogin.Caption = "&Sumbit"
End If
If txtLoginPass.Text = "" Then
MsgBox "Login Password Required", vbCritical, "ERROR"
cmdLogin.Enabled = True
cmdLogin.Caption = "&Sumbit"
End If

End Sub

Private Sub Form_Initialize()
i = 999
Set oConn = New Connection
oConn.Open "Provider=Microsoft.jet.oledb.4.0; Data Source=" & App.Path & "LoginCheck.mdb"
End Sub

Private Sub Form_Load()
picLogo.Picture = LoadPicture(App.Path & "MechLogo.Gif")
txtLoginPass = ""
txtLoginN = ""
End Sub

I get and error with that saying Argument out of range

SQL Prob
hi, i got 2 tables and one table is linked to the other. i want to load the data from both tables in the same query and linking them. the trouble is, the second table might not have a record linked to some of the records in the first but i still want the record in the first table to be displayed

heres a basic idea of my query

where IN('1','2','3') and table2.ldkey=table1.ldkey

ldkey is a unique number for each record in table 1 and when a record is created in table 2 it uses the same number as the one its linked to obv. if the record in table 1 with ID '1' doesnt have a record in table 2 thats linked to it then i still want to display it. is it possible to do that and still have the link?

Another SQL Prob
hi, i have a bunch of record in a table for my forums, it contains a userID, threadID and a time/date field. i want to return all the results where the threadID is a certain number and i only want 1 record per user, if 2 exist in the same thread for the same user then i only want the most recent one to be returned.

at first glance this looked like something that could be done with the MAX() thingy but half way through i got confused.

could anyone please give me a hand

ID Prob
hi, i have a database and there is an id field which is set to autonumber. when i add a record it works ok but if i close my program after deleting a record or something then it will change all the IDs. how can i either stop these numbers changing or make another type of field and have it make an auto increment number when i add a record?

For/next && If/then Prob
I can't quite figure out this problem. Basically, I'm looping through 5 textboxes in an array. First I want to make sure that all the textboxes aren't empty. If they are, then it's supposed to show a msgbox & exit. This part works. The second half is what doesn't work. That part is supposed to check the textboxes that aren't empty for a certain #, 165. If it finds the number it's supposed to remove it from the textbox. If it doesn't find the number, then I want it to check at what pass in the loop it is at. If it is the 5th pass, then give msgbox & exit. This is where I'm having the problem at. I never get the msgbox. It just exits. I tried to use a msgbox to tell me what pass it is at so I can "see" what the problem is and the furthest it goes to is 1. Here is the code:

vb Code:
For y = 1 To 5        allSlots = allSlots + 1        If objTxtAttU2(y).Text = "" Then            emptySlots = emptySlots + 1            If emptySlots = 5 Then                MsgBox "Opponent has no cards in FIELD.", , "Message"                Exit Sub            End If        Else            cardNum = Mid(objTxtAttU2(y).Text, 2, 3)            If cardNum = 165 Then                objCmbGraveU2.AddItem objTxtAttU2(y).Text                objTxtAttU2(y).Text = ""            Else                MsgBox allSlots 'shows 1 & exits - why?                If allSlots = 5 Then                    MsgBox "OMEGA is not in opponent's FIELD.", , "Message"                    Exit Sub                End If            End If        End If    Next y

I've ran the code with the textboxes empty and I get the first msgbox. When I run the code with 1 textbox filled with a # that isn't 165 I don't get the 2nd msgbox. It seems the loop only runs 1 time and exits. I haven't tried running it with a filled textbox with the # 165 yet.

Little Prob
Hi, I'm making a program with vbs
I need to have something, that the user can enter a word and a number.
If word is tree
And the number is 5
Then the programs says 5 times "tree".

I made this(without result):

VB Code:
a = Inputbox ("How many times: ")b = Inputbox ("What to say: ") for i = 1 to i = a    WSH.SendKeys "" + b    Wscript.sleep 200next WScript.Quit


Prob With Act Exe
Hi all VB Gurus,

I m creating an act exe for report generation on excel sheet. In my Act Exe project i m having one form named frmReport,one std module named mdlfunctions and one class named clsReport.
The properties for project set as ,

General Tab

ProjectName - DieboldReport
Project Type - Act Exe
StartUpObject - None,
Upgrade ActiveX Controls - tick
Thread Per Object - tick

Component Tab
VersionCompatibility - Binary Compatibility.

Class Properties as,
Instancing - 5 Multiuse
Persistable - 0
DataBindingBehaviour - 0

I think this all is sufficient info..... Now the code i have written in
ClsReport is,

Public Event Finished(msg As String)

Public Sub ShowReport(ByVal ConnString As String)
Set g_con = New ADODB.Connection
g_con.ConnectionString = ConnString

End Sub

Friend Sub FireEvent(ByVal RptMsg As String)
RaiseEvent Finished(RptMsg)
End Sub

My all business logic/code lie on frmReport.

Now the problem i m facing is, whenever i m trying to create actXExe by selecting File->Make Diebold.Exe the winzip window will get popup for extraction of Diebold.Exe and only after closing that window the execution completes. Plz tell me why the winzip window popup while creating ActExe.

Now the prob with my Client Exe (Std Exe)

I set the reference of above actXExe. Then i create the object of the above component.class using withevents keyword. Then I set Obj = new component.class. Now when i run the application and click button where i have written this code it popup the winzip window again and after closing that shows me the window for "Component Request Pending" ....."Switch To" "Retry".
Even if i click button "Switch To" the window remains and after some time this window disappear and show vberror err number 429 ActiveX Component Cant Create Object....

This is a very big problem me ....plz guide me, what should i do so that i overcome this error.

SQL Prob
Can some help me an tell me why this SQL does not work!!

SET @niTotalOpenLess3 =
FROM [allmatview]

INNER JOIN [Usr_Global_Data_1]
ON [allmatview] .entityref= [Usr_Global_Data_1] .EntityRef
AND [allmatview] .number =[Usr_Global_Data_1] .MatterNO

WHERE [allmatview].entityref IN('ZUR000000000000', 'ZUR000000000002', 'ZUR000000000004')
AND DATEDIFF (day,[allmatview].created, @dtMonthEnd)<90
AND [Usr_Global_Data_1] .Recovery_FPA<> 'R'
AND [Usr_Global_Data_1].File_Close_Date > @dtMonthEnd OR ISNULL( [Usr_Global_Data_1].File_Close_Date,0)

Fax Prob
how do i send a fax usin winfax
i am not gettin the dll file
or is that any option for sendin fax without these 3rd party softwares..

Ini Prob.
Can antone give me some hint about saving and loading options to/from an ini file

Key Prob
ok, what I basically want to do is have my Insert key completely function as my delete key (dont ask why) and was trying to use the sendkeys so whenever the Insert key is detected, it will send {DELETE} but thats not working and the prob I have is if I have to use AppActivate with it, its not going to be possible because the function needs to work with ALL programs, including the desktop...

as well as shortcuts used with it.. shift+insert would do the same as shift+del..


I Have Prob With This...
ok i have some code in a dll and when i call it it nothing happens, i mean it should return the data but its not, ic an put thesame code in the exe and it works fine.

Public Sub SaveSettingString(hKey As Long, strPath As String, strValue As String, strData As String)
Dim hCurKey As Long, lRegResult As Long
lRegResult = RegCreateKey(hKey, strPath, hCurKey)
lRegResult = RegSetValueEx(hCurKey, strValue, 0, REG_SZ, ByVal strData, Len(strData))
If lRegResult <> ERROR_SUCCESS Then
End If
lRegResult = RegCloseKey(hCurKey)
End Sub

I Have A Bad Prob it is..i'm writing a program for one of my friends and i need to connect several forms with menu bar options and command please!!!

Anybody See Me =( Big Prob Here
basic question (form1.Show 1)
frmCarnet.Show 1
when i put that code it will make the you cannot go back to other page that are open except that one but my problem is how to unload only frmCarnet cuz it unload ALL the pages...

Mcq Prob
I am making a programm of multiple choice quesiton i am having a prob to take total correct answer i have 3 question and
i want is when question finished it showed me the result how many are correct i am attaction zip file of my programm
Plz Help me

Best Regards

Little Prob...
I run a VB Project that call another VB project (an exe one) and the second one is smaller. But when I click in the background project (the first one) I want the second project to still be in focus...(because he hide himself behind the first one after he losts his focus)

Anybody can help???

Currently,my prog. has a listbox which displays all the records from db,however right now i need to implement it such that a check box is allocated along with each of the data.How do i do that? Can i use data repeater ?? any ideas ... thanks



SQL Prob
How will i get the Index of Row in Table
IS is possible with T-SQL.
Please help to solv this problem.

Can Anyone Help Here In This Prob Please??
Hi Thanks for replying to me

I developed a inventory control software and I demonstrate to client as well. He is ready to take it, now this software will tell how much stock you have and the value of the stock at the end of the year and other things like the total stock in and stock out

Now he says if Tax department say that your figures are wrong and ask me which software I am using . So what should he say or what he can say is the jaspinder's software is approved by the goverment body or approved by tax department.

SO I would like to know how to do this process

Hope Never Ends Keep On Doing Hard Work
Jaspinder Singh

Ip Prob
I wrote a app using VB 6.0 with winsock, it's a multiuser chat which is downloadable. Problem is that I tested the chat using the ip on my computer, but if I changed that too my real ip and test it It just connect but the server dont get anything so does the client, is like the info get's lost on the internet. Now I thought is because there's conflict of port but it does not work when I changed it. I passed to a friend a he couldnt connect on it.
PLease help me. so far the app work fine no bug but it aip problem.

.net Prob
Hai all,
I have 98 system with .net beta1 version. When i try to run a file, it shows the code instead of webpage. the Virtual directory is on a 2000 server. When run the same file from other 98 or NT systems without .net its working fine. The IE version on all systems is 5.5
Plz help Me

Bitblt Prob In Vb 4.0
i used this code on vb 4.0 to call a function to render a sprites background transparent but it keeps giving an overflow error i cant find why...

rc= BitBlt(picbackground.hDC, 5, 5, picsprite.scalewidth, picsprite.scaleheight, picsprite.hDC, 0, 0, SRCPAINT

Listbox Prob Lol
umm im using Listboxes as a substiture for
menus lol so i can make em look nicer :P

so like for the File menu i have the listbox set
to fit tht and when they HOver over it or click
im gonna have its height changed to show the other
options like Save Open etc.

My problem is i have the size perfect just to show
File so they dont see anything else unless they hover
over it but this annoying little scroll bar appears
and i dont have clue how to get rid of it and i didnt
see anything in its properties tht lookedlike it would help.

Status Bar Prob
i have a wordpad like project with a status bar at the bottom. I have looked at the origional wordpad and when the mousemoves over the menu it displayes a description of each item in the status bar. I was wondering how i would be able to acheive (if their is a way) this effect?
reply asap
thans in advance

Copyright 2005-08, All rights reserved