|
It still effects it even if the updated label is ment to update before the process is ran?
*EDIT* It worked fine but i still have one problem i have my progress bar working fine now and i enable it before i put Application.DoEvents() yet it does not want to like progress along if u know what i mean lol just it stops till i exit the program where the thread continues.
Any command to process this type?
Thanks
Oli
|
|
|
|
|
If your progress bar is written correctly (multi-threaded), then it should update while another part of the form code is blocked.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The code i use is as follows
ProgressBar1.Visible = True
ProgressBar1.Value = 0
Timer1.Enabled = True
Application.DoEvents()
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("calc.exe")
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
pStart.Close()
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value >= 100 Then _
ProgressBar1.Value = 0
Return
End Sub
How would i multi-thread the process?
Thanks
Oli
|
|
|
|
|
You can't do it using a form-based timer.
Read the article that I already posted the link to. Everything is in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
*EDIT*
Never mind fixed it
Thanks
Oli
|
|
|
|
|
I am new to VB.net and have a form with a number keypad on it using buttons. I need to adjust the buttons when the user resizes the form. Can someone tell me how to do this?
|
|
|
|
|
|
Hi...
I am used to VBA so bear with me.
I need to identify if a value from a Stored Procedure falls within a parameter using the "between" syntax. For example, show me all of the records that fall between February 1, 2005 and February 28, 2005.
My problem is one of syntax. I know how to have the Stored Procedure filter the records using a parameter. eg:
Me.daCostingRecSearchByVendor.SelectCommand.Parameters("@TravelDate").Value = CDate(Me.dtpCostingStarting.Value).Date
Not a problem... displays the values I want for a Date I have selected using a DateTimePicker on my form. Here is the twist. I have two DateTimePickers on this form and I want to have the parameter (@TravelDate) select values which fall between the them.
How do I adjust the syntax? I have tried various methods including <> or 'GreaterThanOrEqualTo'... nothing has worked for me so far.
Any advice would be helpful.
Thanks in advance...
Pat
|
|
|
|
|
You need two parameters One for the starting date of the interval, the other for the ending date
Select [mydate],[a],[b],[c],..., from [MyTable] where [mydate] >= ? and [mydate] <= ?
then
<br />
SelectCommand.Parameters("@startdate") = CDate(dtpCostingStarting.Value).Date<br />
SelectCommand.Parameters("@enddate") = CDate(dtpCostingEnding.Value).Date<br />
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Could some one please help me with the understanding how to pass the values to a drop downlist?
What i am tring to do is pass a parameter (@Likethis) from a selected item in a list box or a dropdown to a dropdown or a list box. I am assuming the i will have to attach the @Parameter to the selected item some how and in turn this will set off a stored procedured that will populate the dropdown,..
Please Help,
Erik...
=================I wanted to come back and add my code...
This is what i have been able to come up with.
Please let me know if i am on the right track
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'
Dim cnn As New SqlConnection("data source =desktop; initial catalog= northwind;trusted_connection=yes")
cnn.Open()
'
'You can modify it to
Dim da As New SqlDataAdapter("select * from customers", cnn)
Dim ds As New DataSet
da.Fill(ds, "Test")
'
ListBox1.DataSource = ds.Tables("Test")
ListBox1.DataValueField = "ContactName"
ListBox1.DataTextField = "ContactName"
ListBox1.DataBind()
End Sub
Private Sub dl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
'
If ListBox1.SelectedValue = "Hanna Moos" Then
ddl.DataSource = GetStuffForDDL("PrAmNaMe")
Else
ddl.Visible = False
End If
End Sub
Function GetStuffForDDL(ByVal PrAmNaMe As String) As SqlDataReader
'
'Begin The Madness
'
Dim cnn As New SqlConnection("Data Source= DeskTop; Initial Catalog=Northwind; Trusted_Connection=Yes")
Dim Mycmd As New SqlCommand("GettingParamForDDL", cnn)
'
'If ListBox1.SelectedValue = "Hanna Moos" Then
'End If
Dim PARMHannaMoos As String = "Hanna Moos"
'
Dim PramHannaMoos As New SqlParameter("@PARMHannaMoos", SqlDbType.VarChar, 50)
PramHannaMoos.Value = PARMHannaMoos
Mycmd.Parameters.Add(PramHannaMoos)
'
Mycmd.CommandType = CommandType.StoredProcedure
'
cnn.Open()
Dim Result As SqlDataReader = Mycmd.ExecuteReader(CommandBehavior.CloseConnection)
Return Result
cnn.Close()
Result.Close()
'
'End The Madness
'
End Function
End Class
|
|
|
|
|
I have a aplication using VB.net and CSGL for OpenGl. It works perfect on my computer, but when I try to install it on a computer where .Net is not installed the main window drawing does not work well( a grid drawn with OpenGL that is not displayed corectly, also gif on the main form are not displayed on some computers). On some computers it work on some not. All tested computers have the .NEt framework installed, via the MS updated. Installing .NEt via MS site does not solve the problem. ANy ideeas ?
|
|
|
|
|
pharao92 wrote:
but when I try to install it on a computer where .Net is not installed
The same version of the .NET Framework runtime MUST be installed otherwise your app wouldn't run at all.
Do these machines have an updated OpenGL library installed on them? Preferrably the same version you compiled against.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I have a form with 3 buttons. Cancel, Back and ok.
When the form Launches, depending on whether the form is the first one the Back button should be visible. My Problem is when its the first form, Back button is hidden and there is a space between Cancel and Ok.
I want to right align the cancel button. Is there a simple way of doing it ?
Thanks
|
|
|
|
|
Layout your form how you want it with the Back button displayed. Write down the Location values for each button. Now, layout the form how you want it without the Back button. Again, write down the Location values for the remaining buttons.
When your code that decides when to show, and not show, the Back button executes, change the Location values for the buttons to match how you want them laid out.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
A better way than writing down the location:
In code:
'after hiding the button<br />
btnCancel.Location = btnBack.Location
|
|
|
|
|
|
My front end is vb.net .Can i connect to a oracle db installed on linux as i do with oracle installed on windows
|
|
|
|
|
Of course! The DB server O/S doesn't make any difference to your application or the database provider its using.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I want to display those columns i get from list box to show on the crystal report.
User need to choose the item(s) from my list box and the system will display the whole column info in the crystal report.
fire85.
|
|
|
|
|
Well for Column I am not sure but there are sections in the report. you can make them visible true or false. may be this helps you for hiding columns.. check this code
Dim opt as new report1
' blnShow is my boolean variable to decided either to show the section or not
' dsEmployee is the section in the report
If blnShow = False Then
opt.dsEmployee.SectionFormat.EnableSuppress = True
End If
May be with this code you will find the way of hiding columns...
best of luck
|
|
|
|
|
I want to create a new thread and the attached method with previous thread has 2 params . How can I do that ?
Hung
|
|
|
|
|
This question is too general to provide much of an answer.
However a simple scenario for using threads is to design a class that contains the code needed to create and start the secondary thread. The same class also exposes all parameters needed by the secondary thread as properties.
The parent thread creates an instance of the class, sets all the required property values, then calls the class method to launch the secondary thread. The secondary thread runs whatever task it is supposed to run, and then notifies the parent thread either when it is done or the operation fails.
Notification can be by events (easiest) or by callback functions (more code reqiuired but generally a much better approach).
Robert
|
|
|
|
|
But I need the second thread must return the value. So, if I create new Class to run second-thread, how can I do that ?
Hung
|
|
|
|
|
Just create a module level variable for the return value, have the thread set the value and expose the value as a third public property. In this scenario, the parent thread creates the class, sets the two input parameter property values, starts the secondary thread execution, and when the parent thread is notified that the secondary thread has completed, it can read the return value from a third public property.
Robert
|
|
|
|
|
I have a designed a form which contains 5 Textbox.I have done OlEdb connection as a source code.When i click save button,the data will not be sending to the database ..please help me
|
|
|
|