visual studio 2010 windows forms app screenupdating property

bemis82

Member
Joined
Jun 4, 2011
Messages
14
Programming Experience
Beginner
Hi i'm a noob to .NET developing and have a simple question, i've been stuck on this for a while and searched many forums first with no solution so i'm posting myself. In VB for excel i've used Screenupdating=false to disable the screen updating however now i'm creating a visual studio 2010 windows forms application and its not showing up as a property. Here's the code i've tried.


1Public Class
2
3Public Sub Welcome_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
4 Application.screenupdating = False
5
6End Sub
7End Class



And i get the error 'screenupdating is not a member of 'system.windows.forms.application'.

Thanks.
 
That would be because it's not. If you were to explain what you're actually trying to achieve then we could explain the best way to achieve it. Please don't say "to stop the screen updating". Please provide a full and clear explanation of what you're doing and why you want the screen to not update. The best solution will vary significantly with the details, so we need the details.
 
Hey, bemis, getting into .NET after working in VBA is like listening to Australian. I mean, you know it's English, but... it's not.

So what are you trying to do, mate? :)
There's no such thing as screenupdating in .NET.
 
Robert_SF said:
There's no such thing as screenupdating in .NET.
Not literally, but proper handling of data processing in a UI environment is equally relevant.

ListView control has BeginUpdate/EndUpdate methods that serves same functionality.
BindingSource.RaiseListChangedEvents Property is usually used in same context, where you make changes to the datasource, while preventing each change to update the bound control.

For the most part though, preventing UI changes while processing means do processing in background off of UI controls and only update UI when needed. VB.Net has excellent support for multi-threading.
 
ok maybe this will help

Below is probably a better example of the method that i'm running, its a simple sub routine and while the code is running the form is flashing white while its processing. I would like to stop the white flashes. I'm not sure if there is a property to prevent the form from doing whatever it's doing or somehow to process without affecting the look of the form. I would just like to know what possibilities there are.
thanks again.

Public class
Private
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
Dim sqlquery = "SELECT * FROM customers WHERE ID = '" & swipetxt.Text & "'"
Dim mycommand As New MySqlCommand()
Dim myadapter As New MySqlDataAdapter()
Dim mydata As MySqlDataReader

mycommand.Connection = SQLConnection
mycommand.CommandText = sqlquery
myadapter.SelectCommand = mycommand

mydata = mycommand.ExecuteReader()
If mydata.HasRows = 0 Then
Failed_Swipe.Show()
Else
Pin_Number_Entry.Show()
End If
SQLConnection.Close()
Me.Hide()
End Sub
End Class
 
Back
Top