Multi-threading Forms - Open A Separate Form As A Separate UI Thread From The Start Up Form

Oct 27, 2011

I have a few forms that have a lot of really intensive updating along with a great deal of user interface (text boxes, button clicking etc) Is it possible to open a separate form as a separate UI thread from the start up form that called it to "show" or open or whatever the new method might be?

View 6 Replies


ADVERTISEMENT

VS 2008 [Multi-threading] How To Run This Code In A Separate Thread

Apr 21, 2009

I am creating an IDE for a game script with similar functionality as the Visual Studio IDE (at least, some of it). The game script consist of code that looks visually a bit like C code. It uses braces to define the start and end of a 'class' and uses nested braces to define the start and end of an 'event' in a class.

What I want finally is to have two Comboboxes above the text editor, one that lists each Class and the other listing each Event. The comboboxes should also show the Class and Event that the caret is currently in, just like in Visual Studio.I have attached an example of such a script (you can open it with Notepad).However, here is a short example where you can also see how I "defined" classes and events:

class1
{
event1
{

[code]....

As you can see, the classes are the 'names' of each block of code, defined by matching braces { }. The events are the names of each nested block of code, also defined by matching braces { } but inside a class. There is only one level of nesting.As you can also see, the layout can follow the standard C-style layout, or a slightly different layout (using the opening brace on the same line as the class/event name), or even a completely chaotic mess. As long as the braces match correctly, the code is valid.So in short, the large blocks are classes, while the nested blocks are events.

What I want to do, is parse an entire script, and store all the Classes (and eventually, also all the Events, but let's forget about them for now). I want to store the Class name, start position (defined as the start index of the name), end position (defined as the index of the closing brace) and the full text (defined as the text between start and end position, so including the name).

vb.net
Public Class clsClass
Private _Name As String

[code]....

The code works basically by finding every first opening brace (the opening brace of each CLASS, not event), and then loops through the class (using a brace counter to keep track of the nested braces) until it found the last closing brace. It then stores the name, start, end and fulltext in a new clsClass and adds it to the list to return.

View 3 Replies

Multi Threading - Crashed GUI - Executes A Sub Of My Choice On A Separate Thread

Sep 11, 2011

How can I make my apparently so that when I click a button, it executes a sub of my choice on a seperate thread? I need this to send an email and when I ran it normally it crashed my GUI.

View 1 Replies

Forms :: Multi Threading With Separate Classes

May 7, 2011

I'm trying to dive into what I consider a deeper end of VB.net to see how far I can go with it. I have a project created, ironically called "My First Server". The aim of this is to create a server which can handle multi clients but additionally isn't the commonly shown tutorial setup of a console application. So it is created as a Windows Form application. The main form (Public Class PrimaryForm) consists of only one control which is a listbox control. This is named LogOutput.

[Code]....

View 7 Replies

Load The Main Form Of A WPF So That A Separate Thread Goes And Gets Data From The Database While The Form Is In An Apartmentstate?

May 15, 2012

How do i load the Main form of a WPF so that a seperate thread goes and gets data from the database while the form is in an apartmentstate? (drag-able / movable) I Know this is possible with opening a new window from your main form like this :

Private Sub openOrderWindow()
Dim OrderWindow As Orders = New Orders
OrderWindow.ShowDialog()
End Sub

[code]....

I've tried putting MyBase.ShowDialog() and .Show() and .9000+ other things The only benefit I've got out of using a seperate thread to load from the databse is i can see the screen right away (as oppose to it being a transparent box until it loads) but i cannot move it around or minimize it?is there any way to make it Movable while it loads?

View 1 Replies

Create New Form On Separate Thread?

Jan 10, 2010

I would like my application to do something (in one form) and while form is doing that i would like to show another form to the user. Code is:

Private Sub blaa()
Dim a As New Working() 'working is another form
a.Show()
'Do some stuff
a.Close()
End Sub

But when i make new form i find it is on the same (main thread) and therefore new form also frozes. How to make new form on separate thread?

View 4 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

Start Separate Exe Specific Form?

Jan 6, 2011

This may sound silly but is it possible to run a separate exe and call a specific form to load?

For example:

Let's say I have two exes one that checks licensing and then once that is done it calls another separate exe to load a specific form based on the type of license selected?

It sounds doable but can anyone share a snip it of code that may do the trick?

View 16 Replies

Doing Work In Separate Thread To Prevent Form From Hanging

May 9, 2011

I have a really simple form with a button that fires a Sub I created which gathers data from ActiveDirectory and adds it to an Excel Sheet. The problem is, when I click this button the whole form hangs. So I figured the operation that gathers the data and adding it to the Excel sheet should be run in it's own thread, so that the form won't hang. Possibly it would be great to add a progressbar as well. The progressbar however is located at the Main userform that starts up once the projects is run.

I've got one MainForm.vb and one CodeFile.vb. I want most of the code in the CodeFile.vb so it's tidier.
MainForm.vb
Imports User_edit.CodeFile
Imports System.ComponentModel
Public Class MainForm
Private Sub btnImportData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImportData.Click
[Code] .....

Notice the ExportFromAD Sub I've got in the CodeFile.vb. This is what is actually doing the work. In the For each loop that adds data to the Excel is where I've put the MainForm.MyBackgroundWorker.ReportProgress(i * 10). Problem is, it doesn't actually update the label on the form. Which I find pretty weird because the form isn't really hanging or anything. Is it trying to access a different thread or something? Meaning, the form is run on it's own thread which can't be accessed from my second thread?

View 2 Replies

VS 2008 Start Timer On A Separate Thread, So It Doesn't Block The UI?

Sep 17, 2009

Is it possible to start a timer on a separate thread so it doesn't block the user interface, or do I have to make a thread that I call from the timer?

View 2 Replies

Forms :: Load Progress Bar On Separate Thread?

Apr 29, 2010

I have created a form in which i am loading thousand of records. so i want to display a progress bar.Actually i am moving from MDI main meny to some other form so when i click that menu item i want to progress bar till my total records are not loaded.

View 3 Replies

Cash Register Program With Separate Forms For The Items And The Display Form?

Jan 15, 2011

I have this cash register program with separate forms for the items and the display form. The code works untill you press the button 2x. It says 5.5 + 5.5 = 11.5??? Can you fix this code?

CashReg.ListBox1.Items.Add("Item 1")
Dim cash As String
cash = (5.5)[code]....

View 3 Replies

VS 2008 Multi-threding - Adding Multi-threading Facilities - Cross-thread Operation Not Valid

Feb 10, 2010

I'm adding multi-threading facilities for the first time. I have a function that is wrapped to be run in a separated thread. This function retrieves data (text) from a combobox and it works for sure without multi-threading.

When I call it as multi-threaded, I get the following error when I try to retrieve the data from the cmobobox: Cross-thread operation not valid: Control 'cmb1stBL' accessed from a thread other than the thread it was created on.

It looks like a restriction of thread-safety... I assume that the child thread cannot read from his parent, to make sure that he doesn't change his parent data. So how can I read the data from the combobox? Should I read the comoboxbox data before calling the child thread?

View 4 Replies

Use Threading In Application To Put Two Functionality In Two Separate Threads?

May 2, 2009

I have one applicatin developed in my ap i have two main functionalities

1)Copyig Folders & Files from one source to destination

2) And I am showing status of copying in richtextbox and progrss with progress bar

Here i need to use threading bcz i am copying files from one server to another server and some large size files while copying my application always gone to stuck and i am not able to see status of copying and progressbar so how i use threading in my applicatio to put two functionalitis in two seperate threads.

View 4 Replies

String Manipulation - Separate Three Fields Of The Phone Number And Display In Three Separate Text Boxes?

Feb 23, 2012

I created a telephone number form where the user enters the telephone number in a text box as (nnn) nnn-nnnn. The first 3 digits in parenthesis are the ISD code, the next three are the area code and the last four are the local number. I need to separate out these three fields of the phone number and display in three separate text boxes labeled appropriately. Now, suppose the user enters the phone number in a text box as a continuous string of 10 digits, where the first three represent the ISD code, the next three represent the area code and the last four represent the local number. I'm lost as how to change this string into the form (nnn) nnn-nnnn. This is what I have

[code]...

View 3 Replies

Create Separate Object Instances For New Objects In Separate TabPages?

Sep 17, 2010

I have a TabControl object on my form with many tabs created in code (TabPages) and my problem is that the same objects that are in the initial TabPage needs to be in the other TabPages created in code, I have this done in code when the user clicks the 'New Tab' menu option, however the same code is used for any new tabs created. The problem created here is that I have an event against one of the objects that appear in the other TabPages, but because the same code is used to create any new tab pages, the event will only work on the newest tab page, if that makes sense? By the way these objects that appear on the other TabPages are properties at the top so events can be handled against them in the respective subroutine.

[Code]...

View 5 Replies

Possible To Have Separate Combo Boxes That Will Give Separate ID Values But Using Same Table?

Apr 30, 2010

I'll get straight to my problem - I'm currently coding in Visual Studio.I have a table (countries) with the columns ID | Name. The table is filled with around 28 records.I also have a form with 4 combo boxes (set up as 1,2,3 & 4) that I want the user to select. These combo boxes will display the names from the table countries. I then want to use the selected names in the combo boxes to Insert into their corresponding ID into another table. For example England would have the ID 1, USA the ID 2 etc.So, is it possible to have separate combo boxes that will give separate ID values but using the same table? At the moment I can't seem to find a solution.Eventually the form will have more than 4 combo boxes so I don't want to use separate bindingsources for each combo box.

View 5 Replies

All Of Mdi Child Forms Dont Open When Start From Login Form?

Dec 15, 2011

wen i open mdi through the login form, the forms inside the mdi child forms dont seem to execute.

View 2 Replies

Run A Method On The Main Thread From A Separate Thread?

Dec 31, 2010

I'm reading data from a serial port, but the DataReceived event of SerialPort is handled on it's own thread. I want to handle this on the main thread, but simply declaring an event and raising it still results in it being processed on the SerialPort thread. I'm assuming I need to declare a delegate I can call, but I don't see how that would work.

For example, I want to call Sub HandleDataReceived() on the main thread from the DataReceived thread, having HandleDataReceived() run on the main thread. How would I do this?

View 1 Replies

Access To A TextFields In A Separate Form

Apr 30, 2009

In an application with multitab on a user Form after collecting some information I will plug it into an access database and collect data and disply it with another "Second" User form.On the second user form I make a selection from 1-10 selection on the second user form, and again I will read the access database using the selected data by the user and would like to plug in to the First user form and close second user form.Somehow my textfield is not accessible and I get the yellow tip of "PLName is not member of 'Windows.System.Forms.Form'"[code]

View 4 Replies

Create A Separate Form To Put The Viewer?

Mar 30, 2009

I have a windows form with a textbox bound to a data table and a PDF Viewer both in the same form. I could change the text on the textbox and the Viewer would show whatever is linked to the textbox. I am trying to create a separate form to put the viewer in but at a loss on how to link it to the textbox on the first form.

View 4 Replies

Detecting Victory In Separate Form?

Feb 24, 2009

In a project I'm working on, I have 3 separate mazes, a Splash Screen, and a Module for my global variable(gWin, to detect wins on the mazes). When you finish a maze, I'd like to get it so that it does not allow you to go back and redo a maze, to prevent cheating as I want a final screen to appear when they complete all 3 of the mazes. Is there a way that I can make a variable or something to be able to check if a maze was already completed then cause that maze to have it's .Enabled property set to false?

View 8 Replies

Dock A Separate Process In Form?

Mar 9, 2010

I'm just wondering if there is any way to dock a separate process in my form? For example, Firefox.

View 2 Replies

Have TextBox On A Form In Separate Answer's

Feb 4, 2011

I Have a textBox on a form to give me my IP address (but I have 3 anwser's going into 1 textBox) When I use a button to revile The anwser's,all in one Textbox .How can I seperate Each anwser's with a space. Code Below: (TextBox5 is the TextBox I need to seperate the Answers) [code]

View 12 Replies

IDE :: Get The Toolbox To Be To The Left And Separate From The Form?

Jan 17, 2011

when I open an application to make changes, and I open the toolbox, it appears in the work area with my form. How can I get the toolbox to be to the left and separate from the form?

View 2 Replies

VS 2010 Separate Exe For Individual Form?

Oct 20, 2011

I'm creating a project but I only need exe's as my final thing. I don't know how to put it in simple terms, but here is how I need it to be..The main window remains open i.e.frmMain. ther other forms are only called by an external program (LanSafe UPS Software) every time something happens (Either batteries gets disconnected or power fails). Each of these forms have to be separate executable files. This application is for sending SMSs using Fusion 100 modem. Is what I need possible?

View 8 Replies

Access A Progressbar In Form From A Separate Class?

Oct 18, 2009

I need to be able to access a progressbar in my form from a separate class.

I tried


Dim Prog as Progressbar
Public Property Pg()
Get

[Code].....

I need to be able to access a control from a separate thread and return to the thread again.

Edit: Its just an example I gave prog a value of the object from the form and the invoke required is put in a sub so thats not my problem.

View 3 Replies

C# - Adding Picture Description On A Separate Form?

May 27, 2012

I have picture boxes added to a FlowLayout panel and a ContextMenu strip (associated with picture boxes) with 'Add description' item.

When I right click on a PictureBox and select 'Add description', a new form pops with large preview of the picture and a text box to write the description.

How can I preserve the text written by the user on the new form, after it's closed, so if user wants to edit the description, he doesn't have to type it from scratch again?

I figured I'd have to store the description somewhere and load it into the form when user clicks on the same picture again, but how can I know what picture he clicked on?

View 1 Replies

Check To See If Button Was Clicked In Separate Form?

Jun 1, 2011

okay on my main form i created an instance of another form

Dim secondform As New frmSecond and i called it with this

secondform.ShowDialog() okay now when the secondform pops up there is a "OK" button and "Cancel" button. how can i tell which button was clicked? If "OK" was clicked i want to perform a task, otherwise nothing happens..

View 3 Replies

Keeping Multiple Form Instances Separate?

Sep 16, 2009

When I create more than one instance of the same form and I call a method on any of these instances, the code only fires on the most recently created instance. Even when I click a button on that form, it executes on the other form. How can I call these and keep them as distinct objects?

For example: if I build Form1 with a public method called ChangeMyColor and a button to call that method. Then in the main app I set MyForm1 = New Form1
and MyForm2 = New Form1, then call MyForm1.ChangeMyColor, the color changes on the second instance. Even if I click that button on the first instance, the color still changes on the second.

View 8 Replies







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