|
HI,
Is there way to have the progress bar works according the loading percentage of another application opened from my application?
Thanks.
|
|
|
|
|
No. There is no information that is returned by the system's loader at any time, let alone anything useful for a progress bar.
Your other application would have to expose something like this, but can only do so after it's loaded, started, and initializing itself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Actually, I just need an indication that the application has loaded. If this is the case, is there any way to do it?
|
|
|
|
|
szevy_suez wrote: I just need an indication that the application has loaded.
What does that mean? If you talking about the application initializing itself, then yes you can. All you have to do update the ProgressBar in your applications initialization code.
If you're talking about a progress bar while the application is being loaded from disk, then no, you can't. The system Loader doesn't provide any feedback at all. Your ProgressBar would go from 0 to 100% in one step.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: If you talking about the application initializing itself, then yes you can. All you have to do update the ProgressBar in your applications initialization code.
Sorry, but I don't really understand what you mean by application initializing itself.
Actually, I just want my application to know when the other application has loaded, so I can make that application the active application at that instance and use sendkeys method. So I thought can set a condition if the progressbar is 100% then I can proceed with Appactive and sendkeys methods. I don't know whether it's appropriate, please advice.
Thanks
|
|
|
|
|
szevy_suez wrote: Actually, I just want my application to know when the other application has loaded
As far as the application being loaded is concerned, it's when the next statement after whatever your using to load the other app executes.
But that's NOT when the other app finishes initializing and doing its own startup stuff. There's no way to tell when that's done. The only thing you can do is write a routine to look for the title of a window in that application every so often.
A ProgressBar isn't going to help you at all...
szevy_suez wrote: then I can proceed with Appactive and sendkeys methods
Good luck! Using SendKeys is not the most reliable way to controlanother application. The best method is if the application exposes a COM object model.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi there,
i'm trying to format the date.
once the user the enter the date in the textbox, i want to check whether it is in correct format or not.
so i'm using ISdate () function to check the dates and i want to check the format also . but for the format like (mm-dd-yyyy) i don't know how to check.
Pls help me to solve this problem.
Thanx in Advance.
|
|
|
|
|
textbox.text = Format(date, "mm-dd-yyyy")
Mike Lasseter
|
|
|
|
|
Hi thanx fr ur reply. Actually the date(Date Of Birth) is entered by the user and then we have to check the format. if the format is false then we have to prompt the msgbox says "Invalid format".
Is there anyway to do it.
Help me
Thanks
|
|
|
|
|
First from a user stand point I would much rather be able to enter a date in any format and have the program format the date as it wishes. As a user I don't want to have to keep up with Program A uses this date format Program B uses this format.
What I would do is
<br />
If IsDate(Text1.Text) Then<br />
Text1.Text = Format(Text1.Text, "m-d-yyyy")<br />
Else<br />
MsgBox("Invalid Date")<br />
End If<br />
But if you insist on doing what you are doing you could do the following
<br />
if text1.text <> format(text1.text, "mm-dd-yyyy") then<br />
msgbox ("Invalid Format")<br />
end if<br />
Mike Lasseter
|
|
|
|
|
Hi mike,
Thanks a lot it works.
Regards.
|
|
|
|
|
Hi everyone,
I was wondering if anyone out there knows of a way to compare a datable to another datatable in VS 2003. I would like to compare the two datatables to see if any updates were made to a datatable. Is there a better way than looping through all the records within each datatable? thanks
|
|
|
|
|
To best of my knowledge VS 2003 has no such facility, however, there are quite a few third party applications you can use to compare sql database, and some of them also let you generate script to synchronize both copies.
Sql data compare from http://red-gate.com/ is one such example.
Hope this helps.
Difficult - > Challenging, this simple replacement made me take my life little easy;)
|
|
|
|
|
Thank you Asif for your reply. I guess I will have to find another method to compare two tables.
eatwork
|
|
|
|
|
I am looking for something like this to create it in Visual basic.net. I want to include a calander and then have people be able to enter the name. can anyone maybe help me or point me to the right directions. I need to do this in visual basic.net express. you can view the old schedule by going to www.clinicalsystemsassoc.com/projects/
(i will have the link up in 1 hour from now )
|
|
|
|
|
do you need help building the project? i'm not sure i understand exactly what you mean...
|
|
|
|
|
Yes that would be great if someone could help me. I want to learn. The closet that i came to building a program was the menu i created for my home use and work. I would of course give you credit for it, if you would help me?!?!?!?!
Steve
|
|
|
|
|
let me know when you confirm your email so i can send you a private message. thanks!
|
|
|
|
|
confimed. sorry.
|
|
|
|
|
i sent a mail to the address you gave me. did you receive it?
|
|
|
|
|
I need a vb6 code to read an excel file, determine the number of columns in the first row and transform the columns into a table field.
I want to create a table on the fly using the excel column as fields in a table and now read the remaining rows from excel file as data into the craeted table
thanks for your anticipated cooperatio
t.aransiola
|
|
|
|
|
|
Here is the code I have:
Publicly declare
Public cnnXLS As ADODB.Connection 'ADO connection to MS-Excel
This function creates an ADO connection to MS_Excel
Public Function Set_XLS_Connection(strProv As String, strDS As String) As Boolean
On Error GoTo Set_XLS_Connection_Err
Set cnnXLS = New ADODB.Connection
With cnnXLS
.Provider = strProv
.ConnectionString = "Data Source= " & strDS & ";" & _
"Extended Properties=""Excel 8.0;HDR=YES"""
.Open
End With
If cnnXLS.State = 1 Then
Set_XLS_Connection = True
Else
Set_XLS_Connection = False
End If
Set_XLS_Connection_Exit:
Exit Function
Set_XLS_Connection_Err:
Msg = "Error in Startup module - Set_Database_Connection function. " & vbCr & _
"Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
Set_XLS_Connection = False
Resume Set_XLS_Connection_Exit
End Function
This subroutine lists all the worksheets in the selected Excel file.
Private Sub List_Excel_Worksheets(cnnXLS As ADODB.Connection)
'Purpose: Creates a list of worksheets from the selected Excel file
'Parameters: cnnXLS as an ADODB connection
'Returns: Nothing
On Error GoTo List_Excel_Worksheets_Err
Dim strSheet As String
cboWorksheet.Clear
Set rstSchema = cnnXLS.OpenSchema(adSchemaTables)
With rstSchema
Do Until .EOF
If (UCase(!TABLE_TYPE) = "ACCESS TABLE") Or (UCase(!TABLE_TYPE) = "SYSTEM TABLE") Then
.MoveNext
Else
strSheet = !TABLE_NAME
cboWorksheet.AddItem strSheet
.MoveNext
End If
Loop
End With
List_Excel_Worksheets_Exit:
On Error Resume Next
rstSchema.Close
Set rstSchema = Nothing
Exit Sub
List_Excel_Worksheets_Err:
Msg = "Error in frmTextual - List_Excel_Worksheets subroutine. " & vbCr & _
"Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
Resume List_Excel_Worksheets_Exit
End Sub
This subroutine writes the selected excel worksheet and places it into a FlexGrid.
Private Sub Populate_flxSource_With_Excel_Data(strWrkSht As String)
On Error GoTo Populate_flxSource_With_Excel_Data_Err
Dim I As Integer, nFlds As Integer
Dim X As Integer, Y As Integer
Dim varValue As Variant
If flxSource.Visible = False Then flxSource.Visible = True
If flxTarget.Visible = False Then flxTarget.Visible = True
Set rstXLS = New ADODB.Recordset
rstXLS.Open strWrkSht, cnnXLS, adOpenStatic, adLockOptimistic
With flxSource
.Clear
.FixedCols = 1
.FixedRows = 1
.Cols = intCols(cnnXLS, strWrkSht)
.Rows = intRows(cnnXLS, strWrkSht)
For I = .FixedRows To .Rows - 1
.TextArray(Fgi(I, 0)) = I
Next I
.ColWidth(0) = 600
.ColAlignmentFixed = flexAlignCenterCenter
'Locate the first row under the fixed row
Y = .TopRow
End With
nFlds = intFlds(cnnXLS, strWrkSht)
Call Source_Field_Hdrs(nFlds)
'Retrieve data from the excel workbook
Do While Not rstXLS.EOF
With flxSource
'Locate the first column after the fixed column
X = .LeftCol
For I = 0 To nFlds - 1
If IsE(rstXLS.Fields(I).Value) Then
varValue = Empty
Else
varValue = rstXLS.Fields(I).Value
End If
.Col = X
.Row = Y
.Text = varValue
X = X + 1
Next I
rstXLS.MoveNext
End With
Y = Y + 1
Loop
Call Target_Field_Hdrs(intRows(cnnXLS, strWrkSht), intCols(cnnXLS, strWrkSht), arryElements)
Populate_flxSource_With_Excel_Data_Exit:
On Error Resume Next
rstXLS.Close
Set rstXLS = Nothing
Exit Sub
Populate_flxSource_With_Excel_Data_Err:
Msg = "Error in frmTextual - Populate_flxSource_With_Excel_Data subroutine. " & vbCr & _
"Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & vbCr & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
Resume Populate_flxSource_With_Excel_Data_Exit
End Sub
I hope this helps
Quecumber256
|
|
|
|
|
Hello,
When my combobox loads with the dataset, my textbox control shows only the first record. How can I set the code below so that as I pick a customer name from the combobox, it also shows the same customer name in my textbox?
<br />
Me.cboSelectDealer.Enabled = True<br />
Me.TblCustomerTableAdapter.Fill(Me.CustomerDataset.tblCustomer)<br />
<br />
Me.cboSelectDealer.DataSource = CustomerDataset.Tables("tblCustomer")<br />
Me.cboSelectDealer.DisplayMember = "Cust_Name"<br />
Me.cboSelectDealer.ValueMember = "ID"<br />
<br />
Me.txtCustomerName.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.CustomerDataset, "tblCustomer.Cust_Name"))
Thanks in advance,
Rashar
|
|
|
|
|
<br />
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged<br />
'show the selected customer name in a textbox<br />
TextBox1.Text = ComboBox1.Text<br />
End Sub<br />
i hope this is what you meant.
|
|
|
|