473,473 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get window to repaint

Here is scenario

Parent Form -Call Child Modal Form -Shows Mesage Box then executes Sql
Statement to delete rows in table.

When I execute the sql statement the Message box doesn't completely disappear
/repaint.
Is there a good way to get the MessageBox to hide

IF MessageBox.Show("Delete Table?", "Delete Records", ) = DialogResult.OK THEN

cmdQuery.DbExecute(sSQL)
CloseDB()
ENDIF
Mar 3 '08 #1
3 1447
sippyuconn schrieb:
Parent Form -Call Child Modal Form -Shows Mesage Box then executes Sql
Statement to delete rows in table.

When I execute the sql statement the Message box doesn't completely disappear
/repaint.
Is there a good way to get the MessageBox to hide

IF MessageBox.Show("Delete Table?", "Delete Records", ) = DialogResult.OK THEN

cmdQuery.DbExecute(sSQL)
CloseDB()
ENDIF
<ChildModalForm>.Refresh() before executing the SQL query did not help?

Thorsten Doerfler
--
Microsoft MVP Visual Basic

vb-hellfire visual basic faq | vb-hellfire - einfach anders
http://vb-faq.de/ | http://www.vb-hellfire.de/
Mar 3 '08 #2
Hello sippyuconn,

Apart from Thorsten's suggestion, we can also consider creating a new
thread, and run the db operations in it.

If MessageBox.Show("Delete Table?", "Delete Records") = DialogResult.OK Then
Dim dbThread As New Thread(New ThreadStart(AddressOf RunDBCmd))
dbThread.Start()
End If

Private Sub RunDBCmd()
'Run db cmd.
End Sub

If you have any other concerns or questions, please feel free to let us
know.

Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 3 '08 #3
Could you describe exactly what is happening? Is the messagebox still showing,
and usable? Or does it look like there are remanants of the messagebox on
the parent form, and the parent form is usable? Does minimizing the parent
form (or dragging off/on screen) cause visual corruption to be erased?

You can try calling ".Invalidate()" on the parent form after the parent messagebox
closes

If MessageBox.Show(...) ... Then
Me.Invalidate()
Do Stuff
End If

When I execute the sql statement the Message box doesn't completely
disappear
/repaint.
Is there a good way to get the MessageBox to hide

Mar 3 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
How to draw anmation in window app? I mean... like how can I draw a dot in window at a point then moves to another point and we can see it moves. Please explain in detail.
0
by: prs(tm) | last post by:
I want to show a custom window above the HTML display much like the Info bar in XP SP2. Within IE, the Internet Explorer Server window is a child of a Shell Doc Object View; I've subclassed the...
6
by: Supra | last post by:
i got board working using graphic window in vb.net but no controls adding to form. i am doing checker board game. when i clicked and moved the peg to another location(grid). but how do i get bitmap...
7
by: Mike Eaton | last post by:
Hi All, I have a simple application that allows users to clock in and out and stores the data for use by the payroll department. It spends most of its life as a tray icon and when the user...
0
by: Mythran | last post by:
I can draw onto the console window where I want using a mixture of API calls and the System.Drawing namespace (.Net 1.1). I am trying to install hooks for the window to catch a resize or another...
2
by: diogoko | last post by:
I have some code like: try { someButton.disabled = true; cpuIntensiveCode(); } finally { someButton.disabled = false; } The problem is that someButton is never disabled, because the browser
12
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
2
by: Shelly | last post by:
I have a form that updates and stays in the same window. That is the desired behavior. On this form I also have two buttons. I want those buttons to open up a new window with information taken...
2
by: Bill Jackson | last post by:
It seems that the CaptureMouse method sends an EVT_PAINT handler. The documentation does not mention this...is it somewhere else? Could someone explain why this handler is sent out? Also, I've...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.