Forms :: Form1 Load Event - Drawings Appear For An Instant And Then Dissappear?

Mar 3, 2010

I am trying to develope a small graphics application in VB.NET. My startup form has a picture box with a background image loaded from a file. The user can click spots on the picture box and this draws some circles on it. On exit the coordinates for these spots are saved to a file.In my form load procedure I load the background image, the coordinates for the graphics(saved from the last time the program was run), and then call the drawing procedure.

The drawings appear for an instant and then dissappear. If you click the picture box the graphics re-appear.The form works fine once you do this.I guess the picture box is refreshed by the form load event and this is causing the drawings to be wiped.(I stalled the call to the drawing procedure by using a timer and this works but I am sure there is a proper way of fixing this)Is there a way of ensuring a form is fully loaded or making sure the drawing procedure occurs only when the form is fully loaded?

HERES THE
Private Sub Form2_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized[code].....

View 8 Replies


ADVERTISEMENT

Creating Forms And Objects Through Code In The The Load Event Of Form1?

May 22, 2011

I've been working on creating forms and objects through code in the the load event of Form1, truthfully theres a few questions I have under this one category but to start I want to create a button click event that will check what button was pressed then set that button to a variable. I want the event to treat the button that was clicked like it was that buttons click event.Here's a shortened version of my code (Lol if you can call this short):

[code]...

View 3 Replies

How To Force Form Load Event On Form2 From Click Event On Form1

Nov 16, 2010

I'm trying to execute different code depending on the button clicked (button 4 or 5) on Form1, but when I click on button5 to activitae the code on the Form2's Load event everything is Ok, but when I click the back button to return to Form 1 and click on the Button4 to activate the code on the Form2's Load event again, it doesn't active the Form's Load event, is there a way to form the form load event every time I access it from Form1? [code]

View 7 Replies

VS 2008 Run A Procedure Of FORM1 In Load Event Of FORM2?

Mar 18, 2012

i need to pass on some variables from FORM1 in to a procedure in form load event of FORM2 to say in another way i need to run a procedure (which uses variables of FORM1) which is derived in FORM1 class and in FORM2 load event

View 3 Replies

Forms :: Form Variable Value Blank / Null When Move From Form1 To Form2 And Back To Form1

Oct 27, 2009

In my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon

View 2 Replies

Forms :: Navigate From Form1 To Form2. And Then Close Form1?

Feb 16, 2009

I have got 2 forms ----- form1 and form2

i wanted to navigate from form1 to form2. and then close form1

i did the following code.

-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub

i also tried -- form1.close() and form1.dispose() but all in vain

Problem is that my form1 is not getting closed

View 7 Replies

Forms :: Event Called On Load

Jan 13, 2010

I got a combobox, that when the texted is changed, its supposed to run a query to update a field in my database. Here is the issue The event im using is TextChanged, well unfortunately when the page loads, it changes the text when populating the values. Is there a way to make this event wait to fire until after the list is populated? Ive ran into this problem before with datetimepickers, but I was able to offset it with a boolean, but this combobox is calling the textchanged event everytime it adds an item to the list.

View 1 Replies

Forms :: VB App Terminates Before It Hits The Load Event

Mar 1, 2010

I have a simple vb.net app written using MS Visual Studio 2008 with SP1 and .NET framework version 3.5. This app simply queries a MySQL table into a dataset, makes a csv file from that data and then uses Oracle SQL*LDR to load a local Oracle table. Nice and simple.

This app runs fine on just about any computer or workstation I have tested it on with no issues but when I move it to the workstation it will live on...it shuts down just before it hits the load event. I have tried to capture any errors but so far there do not seem to be any errors generated at any point...it simply terminates with no explanation.

I even went so far as to recreate the project from scratch and still got the same result. this phenomenon only seems to occur on the very pc I am expected to deploy to.

the only thing I know for sure is that it is getting at least as far as the declaration section of the form. Once it has dimmed all objects/variables/etc..it seems to just shut down.

View 2 Replies

Running Tasks On Forms Load Event

Sep 7, 2009

I have two forms. On form one, I have a serious of check boxes and in form two I have functions relating to those checkboxes. When the second form loads, I check the Checked State of the Check Boxes, and run the appropriate functions. This is working just fine. The problem I have, is that the second form doesn't show until the functions that have been selected have completed. It would be ideal if the form would load and then run the functions.

I don't think that I could have everything run on startup, but hopefully there is another method. I know I could load the second form and then just run the code in the previous form, but this is less than ideal, because I can't show the second form as .ShowDialog and I want to be able to split up the code into the other form so that it's not so crowded and easier to read on the first one.

View 5 Replies

WebBrowser Load - How To Get Form1.Load To Do Both Operations

Jun 18, 2010

I Want A Web-Browser (WebBrowser1.Navigate [url]) to navigate to a direct site witha .txt file so the text appears in the browser. ok that works.

When Form1 Loads I want To Use This But It Wont Work WebBrowser1.Navigate[url] but it will only work if form1 contains WebBrowser1.Navigate[url] and button1 = TextBox1.Text = WebBrowser1.Document.Body.InnerText.

Final Question How Can I Get Form1.Load To Do Both Operations

View 4 Replies

.net - Form Load Event Fires Twice Using Interop Forms Toolkit?

Sep 18, 2009

I've been following a codeproject article on using the interop forms toolkit (basically a way for developers to slowly upgrade their VB6 projects to .net by allowing .net components run in VB6)

[URL]

While the .NET form is working fine in all other testing projects and environments, I've found that the Form_load event is actually firing twice once it's in executing in the VB6 runtime.Not only annoying, its forcing my initialization code to execute twice (causing all kind of problems on the second run).

If (runBefore = True) Then

View 1 Replies

B4 Put A Command In The Forms Load Event To Take Out Any Spaces Text In Label1?

Sep 27, 2009

I have a command button that when presed allows the user to rename a label on a control ( form ) b4 its loaded.i want to put a command in the forms load event to take out any spaces b4 text in label1.

View 5 Replies

Forms :: Load Event Only Fires One Time (Loosing Handle)

Jul 17, 2011

I have a form for which the form load event only fires one time. When the program starts. It will not fire again until I end the program and restart. I have tried .show and .showdialog, but it acts the same. I have read about form load events loosing the handles, but my code looks exactly like it should.

Here is the load event code
PrivateSub frmBilling_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
LoadClients()
LoadTherapists()
LoadCPT() EndSub

Here is the code that calles the form.
PrivateSub BillingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BillingToolStripMenuItem.ClickfrmBilling.Show()
frmbilling.show()
EndSub

View 1 Replies

Forms :: Set Listbox Checked On Load - Activate - Shown Event

May 17, 2009

I've been having a problem setting certain items in a listbox as checked when the form is loaded. I have tried putting the code in the form_activate, form_load, and form_shown events and each still crashes when it encounters:

[Code]....

View 12 Replies

Forms :: Exception On Calling Form1 From LoginForm And LoginForm From Form1

Mar 11, 2010

I have login form as start up form and i call Form1 after successful validation and in Form1, i have close button on click of Close i would like to reset username and password fields on loginform to null. If i add code in form1 below i get exception Dim fmLogin As New LogInForm

An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

Make sure you do not have an infinite loop or infinite recursion

I get above on LoginForm below statement Dim fmMain As New Form1

View 1 Replies

Pictures Appear/dissappear Control Within Excel?

Mar 19, 2009

I have a set of pictures about I want to apper within the Excell spreadsheet depending on cell value:i.e.If cell A1=1 I need picture 'X' to appear.I have few different pics I need to appear in the same place within the spreadsheet depending on cell value.Is that possible and how?

View 1 Replies

Load Form2 When Button Clicked On Form1?

Mar 16, 2009

That's all I want to do but I get errors when I do this:

Form2.show ()
Me.close ()

Using VB2008

View 8 Replies

VB 2008 Close Form1 Load Form2?

Sep 19, 2009

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Form2.Show()
Me.Close()
End Sub

i have this code on my MDI parent and on button click i would like Parent to close and form2 to load/show.yet with current code when i click button it closes all the app and doesnt load from2

View 3 Replies

VS 2008 : Load Form1 And Form2 At The Same Time?

Jun 21, 2012

What im trying to do is load form1 and form2 at the same time.I have a setting called hideform2.So when i run both forms at the start up i want to get it so when they click on a close button and form 2 hides.I want it so when they run the application again it dosent show form2 anymore?

View 5 Replies

C# - Difference Between Load Event,Activate Event And Enter Event In The Form?

Mar 30, 2009

I am using VB.NET for Windows applications. What is the difference between Load event,Activate event and Enter event in the Form and in which order the above event is executed.

View 2 Replies

Code Missing In Form1.Load So When The Button Is Clicked

Dec 27, 2009

You have a form with 5 Textboxes and 1 button.

Write the code missing in Form1.Load so when the button is clicked, Textbox5 takes the value Done

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, _

[CODE]...

View 16 Replies

How To Load Data From Form1 Datagridview To Another Form & Update

Jan 30, 2011

All I want is to update the selected row data in form1 to another form2



Form1 Objects
Form1 = MainAppForm
DataGridView = DGVMain <= binded
Button = btnUpdate

Form2 Objects
Form2 = frmUpdate
Button = btnSubmit
15 textBoxes = you can see its name in the code below and all of them are data binded


MainAppForm Code
Pass the selectedrow data to form2 (frmUpdate)

Private Sub btnUpdateDouble_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
If DGVMain.SelectedRows.Count = 1 Then

Try
frmUpdate.ItemIDTextBox.Text = DGVMain.CurrentRow.Cells(0).Value.ToString()
frmUpdate.PartTypeTextBox.Text = DGVMain.CurrentRow.Cells(1).Value.ToString()
frmUpdate.PartNameValueTextBox.Text = DGVMain.CurrentRow.Cells(2).Value.ToString()
frmUpdate.PackageTypeTextBox.Text = DGVMain.CurrentRow.Cells(3).Value.ToString()
frmUpdate.QuantityTextBox.Text = DGVMain.CurrentRow.Cells(4).Value.ToString()
frmUpdate.UnitTextBox.Text = DGVMain.CurrentRow.Cells(5).Value.ToString()
frmUpdate.DescriptionTextBox.Text = DGVMain.CurrentRow.Cells(6).Value.ToString()
frmUpdate.LocationTextBox.Text = DGVMain.CurrentRow.Cells(7).Value.ToString()
frmUpdate.ProjectBoardTextBox.Text = DGVMain.CurrentRow.Cells(8).Value.ToString()
frmUpdate.CommentsTextBox.Text = DGVMain.CurrentRow.Cells(9).Value.ToString()
frmUpdate.OrderCodeTextBox.Text = DGVMain.CurrentRow.Cells(10).Value.ToString()
frmUpdate.CurrencyTextBox.Text = DGVMain.CurrentRow.Cells(11).Value.ToString()
frmUpdate.UnitPriceTextBox.Text = DGVMain.CurrentRow.Cells(12).Value.ToString()
frmUpdate.SupplierTextBox.Text = DGVMain.CurrentRow.Cells(13).Value.ToString()
frmUpdate.ManufacturerTextBox.Text = DGVMain.CurrentRow.Cells(14).Value.ToString()

frmUpdate.Show()

Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
ElseIf DGVMain.SelectedRows.Count = 0 Then
MsgBox("Please select one item to update!", MsgBoxStyle.Information, "Update")
Else
MsgBox("Updating multiple Items is not allowed!", MsgBoxStyle.Information, "Update")
End If

End Sub



Form2 Code
I want to update the data by this code, but it refresh only the data in Form1

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Me.Validate()
Me.SparePartsBindingSource.EndEdit()
Me.SparePartsTableAdapter.Update(Me.InventoryDBDataSet.SpareParts)
'Refresh
MainAppForm.SparePartsTableAdapter.Fill(MainAppForm.InventoryDBDataSet.SpareParts)
End Sub




No problem in updating the data if I put the code below in Form2 load event

Me.SparePartsTableAdapter.Fill(InventoryDBDataSet.SpareParts)



but the problem is, it will refresh all the data in the Form2, and my code in Form1 becomes useless.




Thanks in advance!

View 1 Replies

Load Form2 And Pause Form1 - VbModal Underlines When Try To Use It

Nov 1, 2010

I have tried to use Form2.show vbModal but "vbModal" underlines with a blue error line. I have a second form I wish to pop up and get some data before Form1 code continues. I will have a button or some other means to close the form then I wish Form2 to take that response and go...

View 9 Replies

Load Form2 Instead Of Form1 When Press The Play Button?

Nov 24, 2009

I have 2 forms

1. Form1
2. Form2

It always loads Form1 but never Form2 when i press the play button.How can i make it load Form2 instead of Form1 when i press the play button?

View 1 Replies

Load Form2 On Top Of Form1 Everytime No Matter Location?

May 25, 2009

How can i get form2 to to load exactly center of form1 or a location within the form when i get form2 to show, no matter the location of form1.[code]...

View 10 Replies

Method - Form2 Has An Id That Form1 Passes In Order To Load Information From

Jun 9, 2011

Someone told me that i should stick with method #2, form2 has an id that form1 passes in order to load information from.

method #1

CODE:

method # 2

CODE:

View 7 Replies

Using DirectX To Automatically Change Sreen Resoultion On Form1 Load

May 29, 2010

Can you tell me how to change screen resolution using directX and automatically passing UAC. It should also turn back to the original resolution when the user exits the program.

View 5 Replies

VS 2010 Stop From Changing Focus And Form1 Load Events?

Sep 3, 2011

How do I autoscroll my richtextbox?

Form1_Load events;

How do I make it do this event occasionally? Like maybe every 5 launches, it does the event?

View 13 Replies

Raise A PictureBox.MouseClick Event On Form1 From Form2?

Apr 19, 2009

This seems as though it should be simple to do... Form2 wants to execute Form1's picturebox33 event

Form2 has the following code:'delegate pointer to pass args to form1.picturebox33 event

Public Event ExecuteSpellCorrectionSearch(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)

[Code]...

View 4 Replies

On Load Event - Display Variables On Screen Load In Rich Text Box

Mar 20, 2011

I want a rich text box to display public variables like (pizza toppings links etc that have been selected in other forms) these variables have declare in a module. But I want the rich text box to display these variables as soon as the screen loads ( a on form load event) if you know what I mean.

View 1 Replies







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