|
Hi All,
I am using vb.net2008 and sql server 2005
I have a form there is only one button and a label
and in button click doing some delete operation in the table. I need when I am Click the Button then a message will display on lable that "Deleting..." and after deletion the message will removed.
at the start of the Button Click I am writing :
lable1.text="Deleting..."
.
.
.
Then writing the code for deletion
After complete the deletion I am writing
Label1.text=""
The Problem is the label does not Shows its value, Or Shows when the deletion is complete.
So, What I am doing for it?
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
There are better ways but:
1. create a boolean variable
2. add a timer to your project with a small interval
3. in the timer's tick event:
a. check for the status of the boolean
b. change the text of your label to "" when the boolean is true
c. set the boolean back to false
d. stop the timer
4. move the deletion code to its own sub and at the end of the
sub change the boolean variable to True
5. create a thread address of of your deletion sub
5. in the click event of your button:
a. start the timer
b. set the label's text to "Deleting..."
c. start your thread
My advice is free, and you may get what you paid for.
|
|
|
|
|
Try doing label1.refresh after setting the text each time.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The problem is that this code is running on the UI thread. So, any time your actually executing code, your app is not processing messages from Windows, like WM_PAINT. This tells your window or control to repaint itself, including updating the text you see in a label.
You have two options. The first is very easy. put a Application.DoEvents line right after you set the .Text property of the label. But! There's a problem with this. This command tells the app to process all pending messages in the applications message pump, including other button clicks, or anything else you can click on in your application. This could have disasterous results if you're not prepared for it.
The second option is to move the code that does the deleting to a background thread. You may want to check into the BackgroundWorker component to simplify this about as much as you're going to be able to.
|
|
|
|
|
True dat!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
I think the label does show "Deleting..." but you have Label1.Text = "" so it does show your message but it is changing it from the word "Deleting..." too quick for you to notice.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
Hi
I am trying to bind a control to a property ,but i keep getting an
Exception on the databindings.add part
"Object reference not set to an instance of an object."
though i have instanciated all my objects and within scope
where do i drop the ball ?
Thanks
Dim oMyClass As New TestClass("Test")
Dim oBind As Binding
oBind = New Binding("Text", oMyClass, "StringValue")
Me.TextBox2.DataBindings.Add(oBind)<----------exception
Imports System.ComponentModel
Public Class TestClass
Private m_StringValue As String
Public Event StringValueChanged(ByVal e As PropertyChangedEventArgs)
Public Property StringValue() As String
Get
Return m_StringValue
End Get
Set(ByVal Value As String)
m_StringValue = Value
RaiseEvent StringValueChanged(New PropertyChangedEventArgs("StringValue"))
End Set
End Property
Sub New(ByVal InitialValue As String)
m_StringValue = InitialValue
End Sub
End Class
modified on Friday, September 26, 2008 3:15 AM
|
|
|
|
|
a program that uses the Next method from an object of type Random to produce two positive one-digit integers. It should display a question, such as
How much is 6 times 7?
The student should then type the answer into a Textbox. Your program should check the student’s answer. If it is correct, display “Very Good” in a Label, then ask another multiplication question. If the answer is incorrect, display “Wrong Answer. Please try again.” in the same Label, then let the student try the same question again until the student finally gets it right. A separate method should be used to generate each new question. This method should be called once when the program begins execution and then each time the user answers a question correctly.
|
|
|
|
|
No offense, but did you wait till the last day of the semester to start on your homework?
The people here might help you out if you make an attempt to program this and get stuck and include the necisary information to help you (like you did in the visual studio post I answered). However, they are not going to just write the code for you especially since these are obviously homework assignments.
|
|
|
|
|
|
Well, having read your 6 posts, all I can say is you are a right lazy t*sser who doesn't deserve a pass at any level.
I do have one consolation though, with a bit of luck nobody will employ you in a computing role, so I'll never have to fix your code.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: so I'll never have to fix your code
You mean someone else's code ?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Sadly, thats probably true.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Can we ban you from the forums?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
|
I guess that your math grade will be in par with your computer science grade...
The first assignment might have index zero, making the seventh assignment have index 6, but then the eight assignment would not also have index 6...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Erm
Is that a question or a statement about your program?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
a program that has a procedure or method INTEGER_POWER(base, exponent) that returns the value of:
baseexponent
For example, INTEGER_POWER(3,4) equals 3*3*3*3. Assume that exponent is a positive integer and that base is an integer. The method INTEGER_POWER should use only the looping techniques discussed and MUST NOT USE the Math library methods or the exponential operator, ^. Incorporate this program method into a Windows application that reads integer values from Textboxes for base and exponent from the user and performs the calculation by calling the method INTEGER_POWER. Display the answer in a message box.
|
|
|
|
|
Sitting on your homework assignments until the last minute. Now you're screwed.
Sorry, but were not writing your code for you. Show that you've put in some effort in trying to do your own homework and we'll help. But, until then, you're wasting time...
|
|
|
|
|
Dunno - that seems like a difficult one doesn't it
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Code for a program that print a table of binary, octal, and hexadecimal equivalents of the decimal numbers 1 to 256. If you are not familiar with number systems and conversions, you may research it in the internet or in the library.
Decimal Binary Octal Hexadecimal
1 00000001 1 1
2 00000010 2 2
3 00000011 3 3
4 00000100 4 4
5 00000101 5 5
|
|
|
|
|
Sorry, but were not writing your code for you. Show that you've put in some effort in trying to do your own homework and we'll help. But, until then, you're wasting time...
|
|
|
|
|
Write a program that uses looping to print the following table of values:
N 10*N 100*N 1000*N
1 10 100 1000
2 20 200 2000
3 30 300 3000
4 40 400 4000
5 50 500 5000
|
|
|
|
|
Sorry, but were not writing your code for you. Show that you've put in some effort in trying to do your own homework and we'll help. But, until then, you're wasting time...
|
|
|
|
|
code for an application that reads nonnegative Integer and prints its factorial
|
|
|
|