|
How could I get the file name or path of an image file displayed in a DataGridViewImageCell by clicking on the Cell...?
|
|
|
|
|
I am slightly confused by your question.
If you put the image into the DataGridView, then surely you know the path/filename.
If the image came from a database then it does not have a path.
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.”
Why do programmers often confuse Halloween and Christmas? - Because 31 Oct = 25 Dec.
Business Myths of the Geek #4 'What you think matters.'
|
|
|
|
|
If the image came from a database, either you database stored the path and you haven't retrieved it, or it stored the image itself, in which case, there is no path since it's not stored as a file anywhere.
If you built the dataset yourself from image files, you just need to add the path to the file you used to another column in the dataset.
|
|
|
|
|
Any one out there should help me.
My project is on bluetooth communication. So i want to write a VB.net application that can communicate with the a mobile phone through bluetooth.
|
|
|
|
|
Yes, anyone should definitely help you...
|
|
|
|
|
... and?
You haven't asked a question, so how is anyone supposed to help you??
|
|
|
|
|
Try searching Google for "Bluetooth VB.NET", I expect there are lots of samples out there.
It's time for a new signature.
|
|
|
|
|
|
Hi,
I am using a scanner , that scaner raise an event when scanning a data .
I have got a function listening this event and when the event is raised, it launch a form.
<br />
private sub INIT()<br />
addhandler scandone, addressof afficherForm<br />
end sub<br />
<br />
<br />
<br />
Private sub scan ()<br />
raiseEvent ScanDone<br />
end sub<br />
<br />
<br />
Private sub AfficherForm() <br />
Dim myform as new form<br />
myform.showdialog<br />
end sub<br />
the problem is, i can't scan anymore when my event is raised and while ma new form is running, i have to exit the "new thread" to be able to scan again.
How can i resolve this problem please ?
thanks
|
|
|
|
|
There's not enough here to determine what your actually doing with these pieces of code (like the form you launched), but the most obvious reason why would be that ShowDialog is a blocking call. No other code will execute until that dialog is dismissed. If this is not what you want, change the ShowDialog to Show. Show does not block. The code after it will continue to execute with the new form still showing.
As a side, whenever you show a form with ShowDialog, you are also responsible for calling Dispose on it when you're done with it. Your code doesn't do that anywhere and will leak resources if it's not fixed.
|
|
|
|
|
For some other reason i have to use the ShowDialog mode.
But i guess it is possible to launch the new form not in the thread that launch the event but from the one of the main form.
It blocks because the form is launched from the scanner thread so the scanner is bloqued.
How can i resolve this ?
|
|
|
|
|
The scanner is using a background thread internally. The library is raising the events on the UI (start up) thread. It may be possible to move the scanner component to a background thread also, but you may also run into problems with that. The people who can answer that question are the people who made the scanner and its SDK.
thesum wrote: But i guess it is possible to launch the new form not in the thread that launch the event but from the one of the main form.
You cannot launch forms on anything other that the startup thread. SO, you have another problem. You cannot launch a new form for every scanned page while the first one is still active. You cannot show form after form after form from that event handler because ShowDialog will block and prevent the handler from executing again until the dialog is dismissed. You simply have not choices here. You have to change the design of your app, specifically, change the ShowDialog to Show.
|
|
|
|
|
Yes i understand, but i would like to launch the form from the starup thread and before making my showdilog i would make a removeHandler for my scanner Event.
One solution is to create a timer.
Enable the timer when the scan is done, and in the Time_Tick event, launch my new form (and removeHandler of my scanner).
There are no other way to do this method by other way than using a Timer ?
|
|
|
|
|
thesum wrote: Enable the timer when the scan is done, and in the Time_Tick event, launch my new form
So you're trying to launch the new form on a seperate thread? Not going to work and is pointless.
The whole point behind a ShowDialog call is to stop execution of the code until the dialog is dismissed. Why are you saying that you need to use ShowDialog, but yet not block the code?
|
|
|
|
|
How to read the contents of a PDF in VB.Net
|
|
|
|
|
|
I am using visual studio 2005, 2008.
And now i am converting visual basic6.0 to vb.net.
Strptr function don't be convertet.
So how can i convert?
below is source.
Public Function AToW(ByVal st As String)
Dim pwz As Integer
pwz = StrPtr(st)
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
|
Hi mates,
I have an unbound datagridview which has bound combobox and an insert button for inserting new row.
The problem is when I input data in row 1 it will move to row 3
after hitting enter key.
Example.
--------------------------------------
column1 | column2(boundcombox)
--------------------------------------
row1 | ----> inserted row
--------------------------------------
row2 | ----> inserted row
--------------------------------------
row3 test | 112 ---->original row
--------------------------------------
Note: I have an event that will automatically
fill the data in column2, when input in column1.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Can you show us the code you used to insert the row?
|
|
|
|
|
Heres the code for inserting a new row, it will insert in the middle of two rows, it just NOT insert at the last. it will insert any row you want.
then recount the sequence no.
Private Sub btnInsRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsRow.Click
Dim posRow, seq As Integer
Dim iRow As Integer
Dim dRow As DataRow = dttable.NewRow
Try
If Me.C1tdbgridAnalyze.RowCount <> 0 Then
If Me.C1tdbgridAnalyze.Item(Me.C1tdbgridAnalyze.Row, 4) < 96 Then
With Me.C1tdbgridAnalyze
dRow("OrderNo") = .Item(.Row, 0)
dRow("ItemNo") = .Item(.Row, 1)
If .Row = 0 Then
posRow = .Row
dRow("SeqNo") = .Item(.Row, 4)
seq = dRow("SeqNo")
Else
posRow = .Row + 1
dRow("SeqNo") = .Item(.Row, 4) + 1
seq = dRow("SeqNo")
End If
dttable.Rows.InsertAt(dRow, posRow)
.Row = posRow
.DirectionAfterEnter = C1.Win.C1TrueDBGrid.DirectionAfterEnterEnum.MoveDown
.Col = 0
.Select()
iRow = seq
For seqRow As Integer = 0 To .RowCount
If seqRow >= posRow Then
If .Item(seqRow, 4) <> Nothing Then
.Item(seqRow, 4) = iRow
End If
iRow += 1
End If
Next
End With
End If
End If
Catch ex As Exception
log.Debug(ex.ToString)
Throw ex
End Try
End Sub
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
C#Coudou wrote: Me.C1tdbgridAnalyze.RowCount <> 0
I would personally not check for 0 rows, but test for less than or equal to 0 ie <=0
C#Coudou wrote: For seqRow As Integer = 0 To .RowCount
Will .RowCount not exceed the bounds for a 0 based collection, should it not be .RowCount - 1
You are more than just interacting with a unbound datagrid here, should you not first start with the insert operation and then update the other controls. e.g. dttable, c1tbdgridAnalyze
C#Coudou wrote: posRow = .Row + 1
You then try to insert at position posRow, this is outwith the bounds of the rows collection as this position does not insert exist, if you are on the last row, do you not need to use an AddRow method (not sure exactly which type of control you are using. are you using a standard System.Windows.Forms.DataGridView?
A standard DGV has both an Rows.Add() and a Rows.Insert(position) method for working with the rows collection.
|
|
|
|
|
daveauld wrote: are you using a standard System.Windows.Forms.DataGridView?
No, I'm using component one, the C1TrueDBGrid. Actually my code for inserting row at any position is working. My only problem is when inputting data on the added rows. Ie; i have added two new rows then input data, the data goes to old row when I hit enter key.
My goal is to insert/add a row at any position whether at the first row, middle of two rows, and last row.
I've tried the System.Windows.Forms.DataGridView but it will insert only at the last row, if you have a code that can insert/add at any position. It really can help my problem.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Dear sir,
I have 2005 vb.net Solution, lately when i edit any thing in crystal reports i get build error, i use windows 7 ultimate, when i open the same application in windows xp in the same path it work fine, it also work fine in windows 7 if i open the solution using vs.net 2008.
Here is the build error:
Error 1 The "ResolveAssemblyReference" task failed unexpectedly.
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value)
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck)
at System.IO.Path.GetDirectoryName(String path)
at Microsoft.Build.Tasks.SystemState.FileExists(String path)
at Microsoft.Build.Tasks.Resolver.FileMatchesAssemblyName(AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, Boolean allowMismatchBetweenFusionNameAndFileName, String pathToCandidateAssembly, ResolutionSearchLocation searchLocation)
at Microsoft.Build.Tasks.Resolver.ResolveAsFile(String fullPath, AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, Boolean allowMismatchBetweenFusionNameAndFileName, ArrayList assembliesConsideredAndRejected)
at Microsoft.Build.Tasks.Resolver.ResolveFromDirectory(AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String directory, ArrayList assembliesConsideredAndRejected)
at Microsoft.Build.Tasks.DirectoryResolver.Resolve(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& foundPath, Boolean& userRequestedSpecificFile)
at Microsoft.Build.Tasks.AssemblyResolution.ResolveReference(IEnumerable`1 jaggedResolvers, AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& resolvedSearchPath, Boolean& userRequestedSpecificFile)
at Microsoft.Build.Tasks.ReferenceTable.ResolveReference(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Reference reference)
at Microsoft.Build.Tasks.ReferenceTable.SetPrimaryAssemblyReferenceItem(ITaskItem referenceAssemblyName)
at Microsoft.Build.Tasks.ReferenceTable.SetPrimaryItems(ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound) UniqueFMS
Thank you for help
|
|
|
|
|
It looks like it is were one of the assemblies are installed is in a path that is too deep. (Second line of the stack)
You will need to check which assembly is failing and adjust its location to resolve the issue.
|
|
|
|
|