| View previous topic :: View next topic |
| Author |
Message |
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 27th, 2004 08:23 PM Post subject: Disappearing Boxes |
|
|
I have written a rather large vb6 program with about 30 foms or screens.
There about 50 command boxes on the main screen. In many instances, when I click on a box, the written contents in the box disappears and you can see the contents of the screen behind it, usually the desktop.
When I click on another box, the written contents in the previous box reappears and the written contents of the currently clicked box may disappear.
Any help would be appreciated.
BillM |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 28th, 2004 06:02 PM Post subject: |
|
|
Can you post a screenshot?
Thanks _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Oct 28th, 2004 09:39 PM Post subject: |
|
|
Do you have any for/next or do/loops that don't have DoEvents() functions in them? _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 29th, 2004 06:57 PM Post subject: |
|
|
Yes, I have several very simple for/next loops that don't use DoEvents().
Does that matter? |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Oct 30th, 2004 01:04 AM Post subject: |
|
|
Closed loops tend to make it so that windows don't re-draw. It appears that the program locks up if you have a long or a lot of repetitive loops. Try adding the simple line of:
DoEvents
Add that in the middle of your most used loops or longest running. See if that helps. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 30th, 2004 06:05 AM Post subject: |
|
|
I have found a better smaller form that has the same problem and there are no loops in it.
It occurs between the following statements:
Unload frmChangeMenuInformation
' At this point the screen disappears
frmChangeMenuInformation.Show
' At this point, the program goes to FORM which is below
Private Sub Form_Load()
CheckNameFirstChar = 0
ScreenNameFirstChar = 0
PriceFirstChar = 0
PrinterPortFirstChar = 0
If OptionType = ChangeMenuItemInformation And tempint1 = 0 Then
MenuItemNumber = RecordToChange
tempint1 = 1
End If
Call PriceFile
If XactionType = GetRecordNumber And tempint1 = 0 Then
MenuItemNumber = RecNumber
tempint1 = 1
End If
Get gFileNum, MenuItemNumber, gPrice
lblMenuItemNumber.Caption = MenuItemNumber
txtPrice.Text = gPrice.DinnerPrice
txtAutoPromptNumber.Text = gPrice.AutoDescBoxNum
txtPrinterPort.Text = gPrice.PrinterNumber
txtScreenName.Text = gPrice.TS
txtCheckName.Text = gPrice.DDF
End Sub
'I suspect the above code is irevelant to this situation.
The screen reappears at the End Sub function.
At that point what the contents of the box has disapeared.
Am I not refreshing the screen in some way.?
By the P.T.A.T. asked if I could send a screenshot.
Is there a special program that does that?
I will be sending a screenshot of the form . The boxes "Go to previous menu item number" and "Go to Next menu item number" are the boxes in question. |
|
| Back to top |
|
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 30th, 2004 06:13 AM Post subject: Disappearing Boxes |
|
|
| attached it a snapshot of the form |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Oct 30th, 2004 03:06 PM Post subject: |
|
|
very wierd...try this. In the Form_Activate function, put the line:
me.Refresh
and tell me what happens. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 30th, 2004 06:02 PM Post subject: |
|
|
It keeps getting wierder and wierder. I am making the following changes while working in VB6. If I put me.refresh just before the end sub in the Form_Activate function, the contents of the box does not go away but some of the screen inback appears.
If I put the me.refresh as the first line in the Form_Activate function, the problem completely desappears and the problem seems to disappear.
However, if I take out the me.refresh and start the program again the problem still seems to be gone.
However, If I close the program and reopen it with out the me.refresh the problem reappears.
Whoops, I just ran the program again and now I can see part of the back screen with me.refresh in the first line.
I just made an .exe of the program with me.refresh in both places and the box contents still completely disappears.
In another experiment, I just took this form and removed a lot of miscallaneous lines that depent on other parts of the program and create problems such as unknown variables so I could create this form as a stand alone program and possibly sned it to you guys so you could see the problem for yourselves but the problem disappeared. Will se what I can find out while you guys mull over the rest of this message..
Wierd HUH?
PS: This problem seems to happen in every form where I press a box and the same form is again brought back. |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
wwwursa Newbie
Joined: 27 Oct 2004 Posts: 7
|
Posted: Oct 31st, 2004 04:04 PM Post subject: |
|
|
i have noticed one thing. The boxes normally have had the style property of "graphical" so that I can use color. When I use the "standard" style the problem disappears.!!!!!!!!!!
Also, when I use the "Graphacil" style there seems to be a small white line on the right and top side of the box to give it a 3 d effect even if I use the "Flat" appearance property. I suspect this is normal.
I am creating a form just like the one shown above but removing as much miscellaneus stuff as possilbe to see if I can eleiminate the problem.
In advance, Thanks guys for you help with this nasty problem. |
|
| Back to top |
|
rbgCODE Regular
Joined: 11 Nov 2004 Posts: 54 Location: Manchester CT
|
Posted: Nov 15th, 2004 11:10 PM Post subject: |
|
|
Wow, has it been a while, try simpler, like frm.refres before a do events.. _________________ '><>
'rBg
'><> |
|
| Back to top |
|
shivdasn Regular

Joined: 19 Jun 2005 Posts: 58 Location: India
|
Posted: Jun 20th, 2005 07:05 AM Post subject: |
|
|
| wwwursa wrote: | I have found a better smaller form that has the same problem and there are no loops in it.
It occurs between the following statements:
Unload frmChangeMenuInformation
' At this point the screen disappears
frmChangeMenuInformation.Show
' At this point, the program goes to FORM which is below
Private Sub Form_Load()
CheckNameFirstChar = 0
ScreenNameFirstChar = 0
PriceFirstChar = 0
PrinterPortFirstChar = 0
If OptionType = ChangeMenuItemInformation And tempint1 = 0 Then
MenuItemNumber = RecordToChange
tempint1 = 1
End If
Call PriceFile
If XactionType = GetRecordNumber And tempint1 = 0 Then
MenuItemNumber = RecNumber
tempint1 = 1
End If
Get gFileNum, MenuItemNumber, gPrice
lblMenuItemNumber.Caption = MenuItemNumber
txtPrice.Text = gPrice.DinnerPrice
txtAutoPromptNumber.Text = gPrice.AutoDescBoxNum
txtPrinterPort.Text = gPrice.PrinterNumber
txtScreenName.Text = gPrice.TS
txtCheckName.Text = gPrice.DDF
End Sub
'I suspect the above code is irevelant to this situation.
The screen reappears at the End Sub function.
At that point what the contents of the box has disapeared.
Am I not refreshing the screen in some way.?
By the P.T.A.T. asked if I could send a screenshot.
Is there a special program that does that?
I will be sending a screenshot of the form . The boxes "Go to previous menu item number" and "Go to Next menu item number" are the boxes in question. | \
Boss. Do just one small thing. FIRST, write the 'frm.show' line. AFTER THAT write the 'Unload' statement. i.e., just reverse the order in which the form is unloaded and the other form is shown.....  |
|
| Back to top |
|
|