Forms :: Resolved Update Richtextbox On A Different Thread?

Nov 12, 2010

I've been searching around for ages now but can't seem to find what I'm looking for, anyway came accross this wonderful place so thought ay I'm creating a rewards system for school where pupil earn points for good behavior which they can then use to purchase things like a packet of pens. (They can also have points deducted for bad behavior)

View 2 Replies


ADVERTISEMENT

Forms :: Update Richtextbox On A Different Thread?

Nov 2, 2011

Basic function - enter 5-10 urls. Download all web pages using multi threads and then process it. Then in the end, the text from all threads should end up in a richtextbox. It can't be done using any of my googly searches so i thought about asking this :

how would you update text in a richtextbox from a different thread?

I am being able to download and process web pages. But can't add it to richtextbox.

View 2 Replies

Forms :: What Is The Best Way To Update A RichTextBox

Oct 5, 2009

Yesterday I was working with a RichTextBox and decided to add some formatting to my logging (I've never formatted text in one before!! O_O) ...not quite what I expected! Now, normally I work with plain unformatted text and I have an imposed limit on the number of characters I allow to be displayed in the GUI log. So I did my usual thing: After the length exceeds my cap I remove all the oldest lines from the log and set the most recent log info as the .Text property of the RTB... FAIL! All formatting was lost and things were ugly looking again. Sigh.

[Code]...

View 1 Replies

Forms :: Update RichTextBox With Invoke Using Parameters

Oct 5, 2009

I'm facing the problem of updating a RichTextBox (RTB) from a thread with parameters, I used invoke and methodinvoker:

[Code]...

View 11 Replies

Forms :: Update A TextBox When Running A Thread From A Class?

Sep 15, 2011

I am having trouble accessing the main thread (my form) when calling thread is running in a class (or module). I have no problem to manipulate a data (in a thread) from a form, the textbox can be updated using delegate and invokerequired but it doesn't seem as easy when the thread that processes a variable is handled by a thread that is running in a class.

[Code]...

View 4 Replies

Forms :: Resolved ClassicXP/win98 Style GUI On Vista?

Jan 26, 2010

my application has "picked up" the old style button design. In Vista the buttons have a slight shadow / 3d effect, however, my application appears not be using the default style and instead applying the older XP, Win98 typ appearance. At first it didnt bother me, however, not its annoying and rather than rip all my code out and apply it to a new project, i would prefer to remove the offending code call.

Its a long shot, but i thought i would see if anyone here knew what might be causing it?

View 4 Replies

Forms :: Resolved Deleting Lines In A Text File?

Jan 28, 2010

Ok, I'm new so go easy on me. I don't know if this is in the right section, so if it's not, sorry.

Goal: To delete extra lines in a text file.

[Code]...

View 6 Replies

Forms :: Resolved Search And Display ArrayList Stored In A Hashtable?

Mar 25, 2009

I am new to VB.net and I am trying to work out an exercise from a book I am reading on VB. Basically I am storing some book information in a hashtable using a class called Book to store the book information. I am trying to work out my Search and Display All procedures. My Search will work for the first value in my arraylist but not for any other values. I even added the ISBN to my book class to try and use this as a search point. The ISBN is used to pull the item from the hashtable as well.

In the main code I am having problems with the ButtonSearch and ButtonAll.

[Code]...

View 9 Replies

Update ProgressBar From Another Thread (Thread Is Not A BackgroundWorkerThread)

Nov 18, 2009

I have a program that runs for some time and I would like to update the user on its progress. The rest of the GUI is updated using Delegates and Invokes and such (Java is Soooo much cleaner in this regard - everything is thread safe!!), but there is no invoke method for the progress bar. How can I use a delegate to update the progress bar when there is no invoke to invoke!!

View 1 Replies

Forms :: Thread Cannot Access Another Thread's Member Directly And UI Updating

Oct 18, 2011

I have a small problem that I am sure is due mostly to my inexperience with threading. I have used simple entirely self-contained threads before, but not to a great extent. I understand the basic laws that surround them, such as how a thread cannot access another thread's member directly, and must use delegates.

[Code]...

View 1 Replies

.net - Application.Exit Raises `FormClosed` For All Open Forms From Calling Thread, Generating Invalid Thread Accesses?

Oct 31, 2010

My routine to check for updates is run as a separate process. Exiting the application is required to update, so a dialog asks the user, when an update is found, if they want to exit now. f they do, the code (from the update thread) calls Application.Exit().However, if the FormClosed event of any form that needs to be closed needs to access its controls, an invalid cross-thread operation is detected (which sounds pretty logical).

View 1 Replies

Forms :: Run Processes Synchronously From A Thread Or Backgroundworker Thread?

Sep 4, 2009

How do run processes synchronously from a thread or backgroundworker thread? Is it even possible?We have program that allows the user to download several files from a remote server, compress them, and then email the files.It has several long running processes that must run in order. We want these to run on a separate thread so as not to make the form unresponsive. Does a way exist to do this? We attempted a rather clumsy way of approaching this problem by using background worker threads. When each thread is completed and returned back to RunWorkerCompleted, we start another background worker thread and repeat the the next process. It works somewhat but seems to take a lot of resources to run.

View 1 Replies

Modify A Richtextbox From Different Thread

Nov 3, 2009

im trying to modify the text value of a richtextbox from another thread than the main thread, i've been trying for several hours but i cant get it to work, the text value just doesnt change.this code is in a separate module if that has something to do with it, so im trying to modify the textbox in form1 from another module.[code]

View 4 Replies

Forms :: Thread And Updating Forms - Set Options And Start The Encode By Spawning A New FFMpeg Process

Sep 21, 2010

I'm working on a website where we'll be getting a lot of videos to be uploaded. To keep things simple and secure, I'm just writing VB.net windows app to suck all the files in a directory in, allow you to set some options, and start the encode by spawning a new FFMpeg process.

[Code]...

View 5 Replies

Appending Text To A RichTextBox In A Different Thread And Code File?

Sep 28, 2011

With the intention of creating a program to interface with a serial port device, I recently started learning vb.net. To keep the structure neat the vb code has been split into two places; the first is the code behind for initialising, clicking buttons etc., whilst the second is for managing the comm port. Respectively, these are named 'MainWindow.xaml.vb' and 'ComPortManager.vb'.

In 'comPortManager.vb':
Dim RXArray(2047) As Char ' Array to hold received characters
Dim RXCnt As Integer ' Received character count

[code].....

View 1 Replies

Update UI From Different Thread?

Jun 15, 2010

Im working on a program ( vb 2005 CE framework ). I have mainly two threads, the main one and another one I use it for a different thing.When I tried to update the UI this exception was thrown : Control.Invoke must be used to interact with controls created on a separate thread.well !I have tried to use the INVOKE, but it wouldn't work. this is where I get the error :

Public Sub PaintKeys()
Dim tempLevel As clsLevel
Dim tempKey As ClsKey

[code]....

View 5 Replies

Create A Thread To Update The UI?

Jun 22, 2012

The usual VB way to handle a computationally heavy task is to put it in a background worker thread, while the main thread keeps handling the UI.Say for whatever reason I needed to do this the other way around: the main thread doing the grunt work and the background one updating the UI.Here's what I have so far. The only problem is, while the UI window (Form1) does get redrawn, you can't interact with it, not even move or resize it (the mouse cursor turns to hourglass and won't click).

Public Class ProgressDisplay
Private trd As Thread
Public Sub New()
trd = New Thread(AddressOf threadtask)

[code]....

The client will call it like this (actually in unmanaged c++ over COM but you get the picture):

Dim prog = new ProgressDisplay()
DoLotsOfWork(addressof prog.update) ' DoLotsOfWork method takes a callback argument to keep client informed of progress

View 3 Replies

Update ListViewItem From An Other Thread?

Dec 7, 2010

below is a small part of my asynchronous TCP connection code. When I connect I'm passing a ListViewItem as Object parameter. I'd like to update the ListViewItem once the connection has been established or an error occurs. ServerConnect runs on a separate thread, because it's an asynchronous connection, so I can't update the ListViewItem directly.

Does anybody know how to update the ListViewItem?

I looked at jmcilhinney's asynchronous TCP example in the Codebank forum, but it confused me. I don't know which parts I need and which parts I don't need.

::edit::

One more thing. I also need to update the ListViewItem in the Read sub, but I'm passing "buffer" as Object, so how would I update the ListViewItem there?

vb.net
Imports System.Net.Sockets
Public Class TCP
Private Socket As TcpClient

[Code].....

View 8 Replies

Update More Controls Using A Thread?

Apr 22, 2012

I am trying to write an app that in the thread will do some tasks, the form lokks like this:and what it should is something like this:

- retrieve data, populate a row in the listview, increase the first progress bar
- retrieve data, populate a row in the listview, increase the first progress bar
- retrieve data, populate a row in the listview, increase the first progress bar

[code]....

View 2 Replies

Thread-safe Text Box Update

Jul 26, 2011

I have a TCP server app that starts 2 threads when the server is activated, I want the threads to add text to the textbox on the main form. Here's is what I have tried [code]I have added MsgBoxes at points so I know the Sub updatetext_ is being called, and the text is being passed, they are also showing that InvokeRequired is always FALSE. In any case the textbox txtMessages is not being updated.

View 11 Replies

Update A Form From A Separate Thread?

May 9, 2010

I've looked at the on line doc over and over, and I can't seem to figure out why this won't work. This code runs the thread, and the thread seems to execute the code in the 'threadsafe' sub, however neither the progress bar is updated or the button click performed.

Imports System.Threading
Public Class VisNotify
Inherits Form

[Code].....

View 4 Replies

Update Form Variables During Thread?

Sep 1, 2009

I'm not sure exactly how to describe this. In VB6, there was a Timer command. I could create a variable of type Timer and loop until the current value for Timer exceeded the initial plus a given amount of time. This allowed me to update form variables while the timing loop was executing. How can I do something similar in .NET?[code]...

View 5 Replies

Update UI Form From Worker Thread?

Oct 20, 2010

I am new to multi-threading in VB.NET and have come across a problem whereby I am wanting to append text to a text box on a form from a service thread running in the background.

The application I am developing is a client/server listener, I have been able to get the client and server PC's to talk with each other (confirmed through MsgBox), however I am now struggling to get the service thread on the server to append the text to the textbox, nothing vissible occurs.

I have a form named testDebug which calls a class (RemoteSupport), this class does all the handshake tasks and updates the textbox with the connection data.[code]...

View 2 Replies

Update UI From A Class In A Separate Thread?

May 4, 2010

The code below works fine when I put it in form1.vb and change "form1" to "me" but I can't seem go get it to work from my class.

VB
Imports System.Threading
Public Class Class1

[Code].....

View 2 Replies

Update User Interface From Another Thread

Dec 8, 2009

I'm writing a program in which I'll receive data using serial port using Comport.DataReceived event which I've written in seperate class. Once I receive data from my comport I need to display that data in my listbox in the form. What is the best way to do this?? I don have much knowledge on using delegates. An

View 14 Replies

Use A Thread To Update Components On Form?

Apr 22, 2012

I have a form that looks like this:and i'm using a backgroundworker to update the components:

Code:
Private Sub btnGO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGO.Click

[code].....

View 2 Replies

Asp.net - Deleting A Folder On Another Thread Causes Webpage To Not Update?

Aug 8, 2011

I have a web app which displays a list of emails that need to be sent for the day. The user can select what emails to send, then click a button to generate them. When they click the Send button, a process gets started on another thread which generates the emails, then cleans up after itself by deleting a temp folder. Once the process is finished, the Repeater is rebound to update the User's view and remove the emails that have just been sent so they don't get sent again.

My problem is that when I delete the temp folder from my 2nd thread, the UI doesn't update with the new Repeater data. It updates correctly if I just delete the files in the folder instead of the folder itself, and it also updates correctly if I run the delete the folder on the original thread instead of the 2nd one.

New Thread code

Dim t as Thread = New Thread(New ThreadStart(AddressOf EmailLetters))
t.Start()

Delete folder code

Dim fs = Server.CreateObject("Scripting.FileSystemObject")
fs.DeleteFolder(Server.MapPath(".") + " mpEmailFiles")

Why won't the UI update to show the new repeater values when I delete a folder on another thread?

When you click the button, a thread gets started and a javascript load script starts executing which does a PostBack every 10 seconds. Each postback checks if the thread is complete and updates the Status label showing the result. If I delete a folder from within the background thread, the final update to the status label never occurs. If I remove the DeleteFolder call, it does.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ Import Namespace="System.Threading" %>
<%@ Page Language="VB" Debug="true" %>

[Code]....

View 2 Replies

Created A New Thread To Run With A Loop To Update A Textbox

Apr 17, 2009

I created a new thread to run with a loop to update a textbox (this is just a demo, in reality this thing would go out to a db every x minutes to request an update). I did this on a timer, but i wanted to try to do it on a different thread.. anyways, this is what I have: (one form, one textbox, and this code...)[code]I'm getting a warning through (the "Thread.CurrentThread.Sleep(2000) part is underlined) which states:"Access of Shared Member, Constent Member, enum Member, or Nested Type through an instance; qualifying expression will not be evaluated".

View 5 Replies

Get The Values From A Textbox And Also Update A List Box On Another Thread?

Mar 29, 2012

I have a textbox which will accept a user input for a email address or phone number.I want to using a new thread do a search for various results and populate a listbox.I know i need to do this in another thread so my main form will still operate but how can I do this? I've never used threads before and I know it's tricky to get the values from a textbox and also update a list box on another thread.

View 16 Replies

Handle ErrorEventhandler With A Thread To Update A SQL Table?

Feb 5, 2011

I have an application which runs two threads.

- One thread is the main thread while the other one is to monitor the main thread.

- The errors are written to a custom event log

- There is an event handler to handle the event logs

- When an event occurs I want to create a new thread and update the event to a sql table (pseudo code)

- Also in case their are number of errors/events

how should I handle them (pseudo code)

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved