|
Thanks for help
but this solution didn't solve the problem, my .dll file is registerd as com component and i called it from vb6 modules, i want to get its physical path to read data from config file in the same path, can i get it??
Thanks
|
|
|
|
|
You could Assembly.GetExecutingAssembly, then call GetReferencedAssemblies on the result. That would give you an array of AssemblyName classes, which each have the CodeBase property. If you wanted to check whether they were COM references, you'd have to use Assembly.Load, passing the AssemblyName of the reference in question, and poke around somewhere to see if it has any COM types
Of course, all this presupposes that you're using VB.Net, not VB6. If you're using VB6, then this is irrelevant and you need help of the type nobody on a programming forum can give you
|
|
|
|
|
Not always. Depending on whether the Copy Local property is set or not, it might be referring to a path elsewhere in the file system. This is true even with COM wrappers - they could be generated, copied elsewhere, then the reference updated to that path, with Copy Local off
|
|
|
|
|
Hi,
I need to remove all buttons on my form. I use now
For n As Integer = Controls.Count - 1 To 0 Step -1
Dim c As Control = Controls(n)
If TypeOf c Is Button Then
Me.Controls.Remove(c)
End If
Next
but when I use 0 to controls.count or a for each The routine do not remove all the buttons
So the question is what is the best way to remove all buttons on a form? not all the controls on the form are buttons the OK and cancel are on a TableLayoutPanel these 2 has to stay
Thanks
modified on Tuesday, May 12, 2009 6:32 AM
|
|
|
|
|
jan212r wrote: TableLayoutPanel
There is your problem
jan212r wrote: Controls.Count
controls will only return the controls directly on the form
You'll have to use recursion and check if the current control is a parent control (groupbox / panel / tablelayoutpanel / ... )
if so call the same function and go over all the controls in that parent control
|
|
|
|
|
For Each Btn As Button In Me.Controls
Btn.Dispose()
Next
This removes all buttons directly on the form,
And:
For Each pan As Panel In Me.Controls
For Each pButton as Button in pan.Controls
pButton.Dispose()
Next
Next
Removes all buttons in the panels contained by the form.
Etc..
I think you'll get the trick
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Thanks for the input. But this gives no awnser to the question. I have an option that works, but when I use for each it do not work. It remove about 25% of the buttons.
|
|
|
|
|
I think you haven't understood it properly: That is because those buttons are NOT directly on the form, so you'll have to iterate through each container that might contain a button and then remove it. It's as simple as that
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Thats also the reasen why the are on a other control becourse these 2 must stay on the form, but the others 1-60 depending on the status must all been removed. But when there are 12 (+ ok and cancel) on the form there are only 3 buttons that are removed so there stay 9 + ok + cancel
Jan
|
|
|
|
|
i am trying to remove a DomainUpDown control at runtime. My coding is as follows and it gives error.
Dim UpDown As System.Windows.Forms.DomainUpDown
For Each UpDown In Me.Controls
UpDown.Dispose()
Next
What is the error and how do I correct it.
Someone please help.
|
|
|
|
|
Hi guys,
I added a checkbox column through my code. I want it to be triggered once i check it. The row i am checking should be moved to a db somewhere upon clicking of a button. I cant seem to get the checkbox operational.Can anyone please help. Here is the code im using.
Private Sub FillGrids4()
dgt24T.Columns.Clear()
dgt24T.Rows.Clear()
dgt24T.Columns.Add("Account_noT", "Account Number")
dgt24T.Columns.Add("FirstNameT", "First Name")
dgt24T.Columns.Add("LastNameT", "Last Name")
dgt24T.Columns.Add("BankT", "Bank")
dgt24T.Columns.Add("BranchT", "Branch")
dgt24T.Columns.Add("AmountT", "Amount")
dgt24T.Columns.Add("DateT", "Date")
dgt24T.Columns("Account_noT").ReadOnly = True
dgt24T.Columns("FirstNameT").ReadOnly = True
dgt24T.Columns("LastNameT").ReadOnly = True
dgt24T.Columns("BankT").ReadOnly = True
dgt24T.Columns("BranchT").ReadOnly = True
dgt24T.Columns("AmountT").ReadOnly = True
dgt24T.Columns("DateT").ReadOnly = True
Dim objDR As SqlClient.SqlDataReader
Dim chkC As New DataGridViewCheckBoxColumn
chkC.HeaderText = "Manual Check"
dgt24T.Columns.Add(chkC)
Try
objDR = blogic.RunQueryReturnDataReader("SELECT * FROM t24t")
While objDR.Read()
dgt24T.Rows.Add(objDR("Account_noT"), objDR("FirstNameT"), objDR("LastNameT"), objDR("BankT"), objDR("BranchT"), objDR("AmountT"), objDR("DateT"))
End While
objDR.Close()
objDR = Nothing
Catch ex As SqlException
End Try
End Sub
Thanks in Advance.
|
|
|
|
|
You need to add a handler to the checkbox
<blockquote class="FQ"><div class="FQA">retroville wrote:</div>Dim chkC As New DataGridViewCheckBoxColumn
chkC.HeaderText = "Manual Check"</blockquote>
AddHandler chkC.checkchanged, AddressOf functionname
|
|
|
|
|
Thanks Tom,
The problem is 'Checkchanged' is not an event of the DataGridViewCheckBoxColumn.
Im using the DataGridViewCheckBoxColumn.
Any other suggestions
Thanks in advance
|
|
|
|
|
The only way I know, to do this is to handle the OnCellClick event of the DataGridView. The DataGridViewCellEventArgs passed contains RowIndex and ColumnIndex properties.
You can use the ColumnIndex to test if the cell is your Checkbox column and if so do your move, if not exit.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Scratch my previous answer, I have just discovered a nifty trick!
Handle the OnEditControlShowing event of the DataGridView . Something like this:
Dim HookedChBox as CheckBox
Private Sub OnEditControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles m_Grid.EditingControlShowing
If m_Grid.CurrentCell.ColumnIndex = 2 Then 'use the index for your checkboxcolumn
HookedChBox = TryCast(e.Control, CheckBox)
If HookedChBox Is Nothing Then
Return
End If
AddHandler HookedChBox.CheckedChanged, AddressOf OnManualCheckChanged
End If
End Sub
OnManualCheckChanged is a standard CheckBox.CheckedChanged handler.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi to all,
I have vb.net2005 project with crystal report, I am getting an error (for one report )while opening the report after I deployed the project in some other system.
In the error, It is showing the same path as my local computer(where i have created the project)where initially the crystal report was there. And asking to specify a new path with a dialog box opened.
While creating the setup I have added all the reports and changed the report path as application.startup....
All reports works fine accept one.
Why is that particular report is showing the early path?Please help me out.
Thnaks in advance
-----------------------------
I am a beginner
|
|
|
|
|
This depends on what type of database you using. For instance the Report can work on the Machine you created the report and stop working when you go to other machine. so you have to rebuild the path on the report for it to work on the other machine
|
|
|
|
|
thanks Tiyani...
But it works fine for other report. I have done the same procedure for all the reports.
Since i have given the application path for the report,.on the button click, why is it saying so?....the path exist
-----------------------------
I am a beginner
|
|
|
|
|
Whenever I call a report, an error occur.
The Table "stored procedure name" could not be found.
I'm trying to call a Crystal Report with a stored procedure as its table source.
Anybody experienced the same problem and solved it?
|
|
|
|
|
Hi to all,
I am using Vb.net 2005 with ms access(2007) as back end
For security reason I have put password for the access database.
Could anyone please tell me "the connection string to connect to the database."
Thnaks in advance
-----------------------------
I am a beginner
|
|
|
|
|
Hi,
Refer to http://www.connectionstring.com/
Ramesh Sambari
|
|
|
|
|
|
I'm trying to call a Crystal Report 7 from my Visual Basic 2008 project.
I have used the following codes on my form:
ConInfo.ConnectionInfo.UserID = <user name="">
ConInfo.ConnectionInfo.Password = <password>
ConInfo.ConnectionInfo.ServerName = <server name="">
ConInfo.ConnectionInfo.DatabaseName = <database name="">
For intCounter = 0 To objReport.Database.Tables.Count - 1
objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo)
Next
However, whenever I call it using the code below, I'm still being asked for the login details.
Dim objForm As New frmViewReport
objForm.ViewReport("C:\MyREPORT.RPT", , "@pParam=MyParam")
objForm.Show()
I supply the correct login information (server name, user id, password, database)
but I'm still getting error message "Login Failed. Please try again."
Help anyone? It will be highly appreciated.
BTW, I got the codes also from this site. Maybe I'm just lacking something to make it run.
|
|
|
|
|
At a guess you should be passing objReport to the reportviewer. I think, CR is opening MyReport without creds.
Isn't 7 rather old, I thought CR was up to 11 or 12 by now.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Actually I am passing it to a reportviewer, but still with logon error.
Yup, CR 7 is really old. I'm upgrading to CR 2008 (for the new reports) and I'm just trying to call the old reports done thru CR 7 so as not to do it all over again on 2008.
|
|
|
|