I changed
Private Sub AddListItems(ByVal list As ListBox, ByVal items As String())
for
Private Sub AddListItems(ByVal list As ListBox, ByVal items As String)
And now it say's that ListBox1.Items.AddRange(Directory.Getfiles(Inspfolder))) does not produce a value
ListBox1.Invoke(New...
It's the only way I understand them for now.
Now, if I stick to what I just did.
My invoke looks like this:
ListBox1.Invoke(New Callback2(AddressOf AddListItems), ListBox1.Items.AddRange(Directory.GetFiles(Inspfolder)))
But AddlistItems is underline with the following error:
Error 1 Method...
I have so many questions when I read all this...
I guess I'll give it another try, but this is so over my skills.
Here is what I've done as a 1st step:
'This is your exemple:
Private Sub SetControlText(cntrl As Control, text As String)
cntrl.Text = text
End Sub
'I addaped to mine as...
Getting an error of "Incorrect parameter numbers" (TargetParameterCountException) at line 48
I'm confuse... not sure I can figure this out. Let me know if sending the whole code would help...
To explain what I'm trying to do:
I have an excel worksheet holding a bunch of inspections. Each...
Ok, so I went to read about UI thread and this part much more clear in my head. I did as you mentionned and added:
Private Sub AddListItems(list As ListBox, items As String())
list.Items.AddRange(items)
End Sub
Now the second part is still vague for me, I tried calling the Invoke inside my...
Good day, I am trying invoke a Listview and I can't get it to work.
I am getting the cross-thread error at line 31
Inspfolder is my variable for passing filepath from an excel worksheet.
I manage to get it working if I use:
Process.Start("explorer.exe", String.Format(Inspfolder))
But I'd...
Alright, so before I head to bed; this is where I'm at.
No rush for any answers, get some rest and we'll exploit your brain tomorrow!
Until then, this is what I did, I tried making a Thread for Clearalltext and it gave me an error at line 31 and probably all the other lines underneath as showed...
This was my 2cent worth of try:
Public Class RSIform
Dim MonThread As New Thread(AddressOf Rangeloops)
Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object)
'Dim MonThread2 As New Thread(AddressOf Clearalltxtboxthread)
Private Sub...
A lot more clear when I can see it with my eyes.
As for the "row = row + 1", you are right, it's useless and I took it out.
I also changed Exit for for Exit Sub.
Makes more sense that when the value is found, no need to keep looping.
Shall I start showing what I had for the Clearalltext() part...
Dim values As Object(,) = rg1.Value
For i = 1 To values.GetUpperBound(0) 'rows
If values(i, 3) = value Then
'update UI
TextBox_RDIMS.Invoke(New Callback(AddressOf UpdateUI), TextBox_RDIMS, values(i, 19))
TextBox_RSIG.Invoke(New Callback(AddressOf UpdateUI)...
This is where I am :
Private Sub ExecuteWork(ByVal value As String)
Dim row As Long
row = 1
Dim Inspfred As Worksheet
Dim Inspchris As Worksheet
Dim Inspjr As Worksheet
Dim Inspluc As Worksheet
Dim Inspted As Worksheet
Inspfred = Form1.xlWorkBook.Sheets("Inspfred")...
Good Sir,
Please note that this is not my first language to start with. It adds in the complexity of things. Also, "Threads" are completely new to me and I have to admit that just reading what it does is making me dizzy. It has nothing to do with the way you are explaining it. You are very...
I am trying to adjust the thread and I'm having a cross thread error with line 19
Private Sub ExecuteWork(ByVal value As String)
Dim row As Long
row = 1
Dim Inspfred As Worksheet
Inspfred = Form1.xlWorkBook.Sheets("Inspfred")
Dim rg1 As Range 'Range...
I got rid of all the other loops and kept:
Private Sub Rangeloops()
Clearalltextbox() 'Make sure all fields are empty while switching form child to child
TextBox_selectednodes.Text = TreeView_Insp_Records.SelectedNode.Text
Ping_network()
Dim row As...
Good coding comes with experience. Experience, well that comes with bad coding :P
Hope this is right:
Dim i As Long
For i = 1 To rg1.Rows.Count 'Range for Inspfred
Dim values As Object(,) = rg1.Value
If rg1.Cells(i, 3).value =...
I'm confuse as do I need to make those changes in the " Private Sub Rangeloops() " where all my orginal loops are, or the " Private Sub ExecuteWork(byval value as string) " which is the thread, or both of them ?
I've adapted like this to try but I don't see any significant changes in term of...
i have seen post 11. I did not ignored it. I tried but im confused on where and what to change exacly. It doesnt take much as you can see. Could you just show me an exemple with my code in my last post by applying to rg1 ?
Imports System.Threading
Public Class RSIform
Dim MonThread As New Thread(AddressOf Rangeloops)
Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object)
Private Sub ExecuteWork(ByVal value As String)
Dim row As Long
row = 1
Dim Inspfred As...
Option Explicit On
Imports System.Threading
Imports Microsoft.Office.Interop.Excel
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
Dim MonThread As New Thread(AddressOf Rangeloops)
Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object)
Private...
Option Explicit On
Imports System.Threading
Imports Microsoft.Office.Interop.Excel
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
Dim MonThread As New Thread(AddressOf Rangeloops)
Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object)
Private Sub...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.