Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics

Post new topic   Reply to topic
Disappearing Boxes
View previous topic :: View next topic  
Author Message
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 27th, 2004 08:23 PM    Post subject: Disappearing Boxes Reply with quote

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
View user's profile Send private message Send e-mail
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 28th, 2004 06:02 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Oct 28th, 2004 09:39 PM    Post subject: Reply with quote

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
View user's profile Send private message
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 29th, 2004 06:57 PM    Post subject: Reply with quote

Yes, I have several very simple for/next loops that don't use DoEvents().

Does that matter?
Back to top
View user's profile Send private message Send e-mail
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Oct 30th, 2004 01:04 AM    Post subject: Reply with quote

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
View user's profile Send private message
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 30th, 2004 06:05 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 30th, 2004 06:13 AM    Post subject: Disappearing Boxes Reply with quote

attached it a snapshot of the form
Back to top
View user's profile Send private message Send e-mail
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Oct 30th, 2004 03:06 PM    Post subject: Reply with quote

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
View user's profile Send private message
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 30th, 2004 06:02 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Oct 31st, 2004 03:51 AM    Post subject: Reply with quote

Hi wwwursa,

Can you start a new blank poject and put some textboxes and stuff in that...and check weather this happens in new project or not ?

This problem can only be resolved by testing! Confused

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
wwwursa
Newbie


Joined: 27 Oct 2004
Posts: 7

PostPosted: Oct 31st, 2004 04:04 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
rbgCODE
Regular


Joined: 11 Nov 2004
Posts: 54
Location: Manchester CT

PostPosted: Nov 15th, 2004 11:10 PM    Post subject: Reply with quote

Wow, has it been a while, try simpler, like frm.refres before a do events..
_________________
'><>
'rBg
'><>
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
shivdasn
Regular


Joined: 19 Jun 2005
Posts: 58
Location: India

PostPosted: Jun 20th, 2005 07:05 AM    Post subject: Reply with quote

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..... Smile Cool
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic