Access Controls From Alternate Threads?
Sep 11, 2010
I'm trying to update the UI from a background thread, but the method I'm using at the moment isn't working. From what I've been reading, the method I'm using should work, but it isn't.[code]...
View 8 Replies
ADVERTISEMENT
Dec 30, 2011
A recent project of mine has been to make a designer. I've finished everything, but when I click the controls to show the properties window, the control interacts with the cursor. So my question is: How do I freeze the controls from interacting with clicking or key presses without disabling the control itself?
View 11 Replies
Dec 15, 2009
I have written a simple module to access NTFS Alternate Data Streams (ADS), which looks like this:
Imports System.IO
Module Module_ADS ' Alternate Data Streams
Private Const GENERIC_ALL As Int32 = &H10000000
[code]....
View 2 Replies
Jun 8, 2010
I've just recently figured out threading, and how to use it. I was even able to figure how to make a background thread modify the text property of any form control that has a text property.
I figured if you could specify the name of the control whose Text property you want to modify, it could be done easily, and I was right[code]...
Is there a way that you could do this, but eliminate the need to specify the control type as a parameter and maybe have the application determine what control you're trying to use by it's name?
View 2 Replies
Jul 3, 2010
I've created a news ticker control, which reads from RSS feeds and scrolls the text Horizontally. The plan is to have 3 of these on my Windows form, which will each display their own information.
The control is created as a label, which is populated with the text, and then scrolls right to left using a timer, once the label gets to the end of the text, and disappears of the left side, the rss is re-read, and then the cycle resumes. The problem is that with multiple copies of this controls on my form, once one gets to the end of it's run, all three freeze while the rss is reread, rather than just the control that needs to do it.
Is there a way to run each of these controls independently (threading?)? Or is there a glitch in my code causing this? (below - some elements not included, but it should be fairly obvious what is happening!)
[Code]...
View 7 Replies
Oct 27, 2010
With threads and parallel processes you can process raw data but notcontrolsUielements) because they belong to another thread,
View 1 Replies
Jun 19, 2009
How do you access a link with rel="alternate" using process.start?
Dim Internet As New Process
Dim InternetAddress As String = eL(DiUs, 0)
Internet.StartInfo.FileName = InternetAddress
Internet.StartInfo.WindowStyle = ProcessWindowStyle.Normal
Internet.Start()
eL(DiUs, 0) is a link to an RSS, but the post won't show unless the link is rel="alternate". How do I do that?
<link rel="alternate" href="http:..........." type="text/html" />
View 3 Replies
Oct 17, 2011
I have been working on a small side project that will read in from a serial port and send off a email depending on what it receives. At the moment I am stuck with a problem of it telling me it cannot access the text box as it was created on another thread. Does anyone know what I can do with this error? I have tried using invoke statements but it does not seam to work. [code]...
View 2 Replies
Mar 18, 2011
I recently had some problems with the performance of the Word object model. In an add-in that I wrote for Word I need to parse through all the words of a document and replace some of them or ask the user for the ones that have multiple replacements. I know that it is faster to ask Word for all of the document text content at once and then process it and put it back all at once again, but this is not suitable for my add-in because I need to have access to the range objects that represent the words that have multiple replacements so that I can somehow mark them in the document and present the user with a tool tip from which he can select the replacement he wants.
So for the moment the single great speed improvement that came in my head was multithreading since most people already have dual core or better. The problem is that all the things you find on Google say that multithreading in Office is a very bad thing to do.
So is there any one who managed to do this in a manner that worked in most of its usage? By this I mean if it also worked on other PCs then the development one?
View 1 Replies
May 13, 2009
I've been building controls for many years professionally and personally, but even back in VB6 days I just could not work this out. After all this time I remembered about it again.If I create a usercontrol/containercontrol and add one or more controls to the controls surface, I just cannot figure out how to access the controls at design time.
View 4 Replies
Oct 19, 2011
I just had a new, last-minute idea on to take on a task, so I am running to StackExchange for quick help.
What I want to do is execute a series of methods right in a row, each in their own threads. I want the application to wait until all of these threads are completed, after which the program will resume. It also has to use managed threading (thread pool).
What quick examples could you provide to help me along the way? If it's too complex, what things should I know about so that I can Google it on my own?
View 1 Replies
Dec 30, 2009
I have a main thread which is designed to be a batch processor - it spawns a series of 'child' threads from a loop (which can vary in terms of the no of items) - see below
[Code]...
However, each of the 'child' threads could take anywhere from milliseconds to about a minute to process - depending on the complexity of each calculation. There may also be a large number of child threads - e.g 100s. Creating large numbers of child threads is not efficient. I therefore want some way to effectively queue each child thread (and cancel if the process is taking too long to complete). Autoevents seems like one way of doing this, but the only examples I can find seem to assume there are two different processes on seperate threads, not one process being repeated.
View 4 Replies
Apr 14, 2010
I am using Synclock to prevent multiple threads from logging text messages to the same file at the same time, but this doesn't seem to work:I get frequent sharing errors on the logfile, within the synclock block.The Synclock is using the variable holding the filename, because it exists all the time and because it is always the same object, whatever class instance or thread I'm in.[code]Despite using Synclock and a Using block around the code, I keep getting this error in the sw.WriteLine(Msg) line:System.IO.IOException: The process cannot access the file '(filename)' because it is being used by another process.Should I use some other type of object than a string to synchronize on?I cannot use a user interface object (button or so) because it is a windows service project.It was written and compiled in Visual Studio 2008, but targeting the 2.0 framework because it has to be able to run on some old Win2000 machines.
View 12 Replies
Oct 20, 2009
I am considering a piece of code that will manage access to a collection object from multiple threads - add, update, remove, clear. OK ... so I have put a sync lock within each method, but what is not clear from the MS documentation is exactly how the sync lock is behaving. Is it locking the piece of code it wraps? Or is it locking the object? And if it is locking the object a private static object should lock out any code locked on the object within all instances of the object? i.e. if an add operation is underway, an update, delete or clear will wait for the lock to be released.
Finally, if I have multiple threads contending for the sync lock, how is the release managed? First come, first serve? random (from my p.o.v)? Is there a chance that two separate threads could blunder into 'locked' code simulataneously?
View 2 Replies
Apr 27, 2012
What appears to be a simple logic implementation is embarassing me each time I try to get it done. I have a very simple task: loop over rows in a DataTable and each time the next row is reached, set a variable alternating between 0 and 1.
Dim the alternatingValue as Integer
For Each dr As Data.DataRow In DT
alternatingValue = 0
Next
...so, when this loop finishes with this row, I need to set the alternatingValue = 1 Then when the next loop finishes, I need to set the alternatingValue = 0?
View 20 Replies
Jul 15, 2010
one of my forms wont load! it is not underlined in blue or whatever but it keeps giving me a runtime error and i dont know why bc it was working before
Code:
Private Sub AddEmployeeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddEmployeeToolStripMenuItem.Click
NewEmployee.Visible = True 'throwing the error
Me.Enabled = False
End Sub
thats how i have been opening my other forms too but just this one gives me this error "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object."
View 6 Replies
Feb 15, 2011
we develop a dll in vb.net and we call that dll in our application .eacgh and every time we register the dll using regasm method.is there is any code for register the dll
View 6 Replies
May 6, 2009
Basically,I would like to bind the data into datagridview which called PODetailsGrid during page_load. After the data had been bind into the gridview,I would like to make alternate color in each row. For example, the font color for row1 is Black,then second row should be Red,then third row will be Black again..
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GeneratePODetailsView(GenerateDataSource())
End Sub
[code]....
View 1 Replies
Nov 19, 2011
I know how to have alternate row colors with ListView. But how about with ListBox? I've run a search. I read in some web sites where they say you can't. Is that true? Meanwhile, I've done something like:
For i As Integer = 0 To ListBox1.Items.Count - 1 Step 1
If i Mod 2 = 0 Then
ListBox1. BackColor = Color.FromArgb(150, 250, 255)
Else
ListBox1. BackColor = Color.White
End If
Next i
with ListBox's DrawItem event. And it doesn't work.
View 8 Replies
Mar 5, 2011
In the program I'm writing I need to have a form load a web page and insert a username and password, then if the resulting site of the login is the error page, it will show the original login form and if it succeeds in the login, it will show another form.[code]...
View 5 Replies
Sep 21, 2010
I would like to get a 'due' or predicted inspection date based on alternating with another date? How would I go about this? [Code] The due inspection either can be 24 months (second yearly) but it has to alternate with the last safety inspection.
View 1 Replies
Oct 7, 2011
I'm fairly new to VB.net and this is my first post on this forum.I'm creating a website in Visual Web Developer 2010 Express in ASP.NET/VB and I'm trying to find out how to alternate a Reponse.Redirect, basically I'm looking to redirect every other visitor to go to a different site.
For example:
Visitor 1 gets: Response.Redirect("http://site-a.com")
Visitor 2 gets: Response.Redirect("http://site-b.com")
Visitor 3 gets: Response.Redirect("http://site-a.com")
Visitor 4 gets: Response.Redirect("http://site-b.com")
and so on
Also, if there is a way to set a cookie for that visitor, so if they visited within let's say the last 90 days, they will go to the same site they visited before, and not be redirected by the Response.Redirect.
View 4 Replies
May 19, 2010
Currently I'm working on a program that will run out of my startup folder when I logon to windows so instead of typing in a password my program will run fullscreen blocking any access to Windows until the user presses the buttons on the form in the correct order. In order for this program to actually be purposeful i need to block keystrokes such as "Alt-F4" and "Cntrl-Alt-Delete". I've looked around on google searches and I usually find a similar solution but when
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Public Class Form1
[code].....
View 10 Replies
Nov 8, 2010
I want a supervisor override capability for my application.I want to provide a username login prompt (including domain). If the user is in the approved list and the password correct, show advanced controls.What .NET code / functions allow this?
NOTE: VB.net answers preferred. C# also accepted.
EDIT: the logged in user is not the user authorizing the override.
View 2 Replies
May 6, 2009
Basically,I would like to bind the data into datagridview which called PODetailsGrid during page_load. After the data had been bind into the gridview,I would like to make alternate color in each row. For example, the font color for row1 is Black,then second row should be Red,then third row will be Black again and so on..
Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GeneratePODetailsView(GenerateDataSource())
End Sub
[code]....
View 3 Replies
Dec 4, 2009
I am writing a program that stores filenames, along with a lot of information about the files in a database. I need to be able to open these files in three different programs from my application. One of these programs, AutoCAD is the default program for the files, but the other two are more difficult. These two need to open the file in a program that is not the default for the file type. Eventually, I'd also like to allow users to point the application to the instance of AutoCAD, MasterWorks, or FeatureCAM that they want to open. I have found articles that explain how to open a file in a default application and articles that tell me how to open any application with a file name, but only 1 suggestion of how to control the program used to open the file. For some reason I cannot get AutoCAD to recognize the file I feed in if I use this method though, so I think it's wrong. This is the method I found that doesn't work:
Start("D:Program Files (x86)AutoCAD 2007acad.exe", file)file is a variable that contains my file name. Since this works fine when I take the program path out, I know the filename is correct, but AutoCAD says it is not.
View 2 Replies
Mar 5, 2010
Setup and deployment project template is missing in my installation
View 2 Replies
May 7, 2009
I created a VB.NET Winforms app a while ago that printed drawings. The way it did this was to copy files from a network share to the folder for a plotter's que. This plotter would automatically just print anything that was dropped into this folder, which was specified with a path like \Btltmkeng_plt_q. I would do this by using the System.IO.File.Copy method. This worked well, until the company switched to a new printer. When my app copies the file, the printer only prints blank pages.
However, if I open two Windows Explorer apps, and manually drag the file from the network folder to the printer que folder, it works! This proves that the printer can handle these files if they are properly copied. Therefore, I was wondering if there were "alternate" methods for copying files in VB. I tried using the My.Computer.FileSystem.CopyFile method, but that just error out saying it could not find the target folder. Is there another method that more closely resembles what happens when files are copied using Windows Explorer?
View 6 Replies
Apr 6, 2012
What I am trying to do is create a form with a button and a list box. When clicked the button will generate a list of 3 or 5 characters that have alternate letters and numbers...eg.
q2h
a6j
z4p
d9k
[Code].....
To complicate things a little, each combination needs to be different, ie. randomised but still according to the 'letter,number, letter' formula. There are plenty of examples of randomising strings such as passwords but I cannot understand how to achieve the above.
View 2 Replies
May 18, 2009
I am attempting to make a piece of software that monitors a 3rd party process for injected code. I successfully made a program that uses readprocessmemory from kernel32 to search for strings in a process. My problem is that the process I am attempting to monitor is running as system and provides an access denied message when I attempt to query any information about the process. Including process.handle and process.modules. Are there any ways I can get this process' handle?
View 4 Replies