Questions tagged [form-load]

61 questions
15
votes
5 answers

C# WinForm - loading screen

I would like to ask how to make a loading screen (just a picture or something) that appears while the program is being loaded, and disappears when the program has finished loading. In fancier versions, I have seen the process bar (%) displayed. …
CaTx
  • 1,421
  • 4
  • 21
  • 42
9
votes
4 answers

What is the best way to call a method right AFTER a form loads?

I have a C# windows forms application. The way I currently have it set up, when Form1_Load() runs it checks for recovered unsaved data and if it finds some it prompts the user if they want to open that data. When the program runs it works alright…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
7
votes
1 answer

Explain critical bug in Visual Studio 2010 and up, WinForms and WPF

Try putting the following code inside Load event handler for WinForms or Loaded for WPF. Dim doc As New XmlDocument Dim nsmgr As New XmlNamespaceManager(Nothing) 'this line throws an exception Problem is that exception is not thrown, and stack…
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
4
votes
4 answers

To Form Load() or Not to Form Load()

Should I load child forms in the Constructor or the FormLoad()? I have some code that is calling a custom class that embeds a form in a control. I had originally been declaring my child forms outside the Constructor and then calling a FormPaint()…
Refracted Paladin
  • 12,096
  • 33
  • 123
  • 233
4
votes
10 answers

Form1_Load not firing even after adding handler

It's been a long time since I've dabbled with C#, but I'm having a heck of a time getting my form_load to fire. This is the most simple thing I can't imagine why it won't fire! Any assistance would be appreciated. using System; using…
Dutchie432
  • 28,798
  • 20
  • 92
  • 109
4
votes
4 answers

How to click a button on form load using C#

How do i click a button on foam load using C#? My button is called: btnFacebookLogin I have tried this following: private void Form1_Shown(Object sender, EventArgs e) { btnFacebookLogin.PerformClick(); } I am using WinForms C# .NET 4
PriceCheaperton
  • 5,071
  • 17
  • 52
  • 94
3
votes
2 answers

How to stop a form from loading in c# windows forms

I've a windows form application where it ask the user to login before loading the entire form. If the user cancel the login then i've to stop the form loading and quit the application. In cancel_Click() method im calling this.Close(), but it is…
user626660
  • 135
  • 5
  • 9
3
votes
3 answers

C# designer is not shown when Inheritance form

I have a problem in deriving a form called PrinterForm This is the code of the parent form: public partial class PrinterForm : Form { public PrinterForm() { InitializeComponent(); } private void PrinterForm_Load(object…
Lorenzo Belfanti
  • 1,205
  • 3
  • 25
  • 51
3
votes
1 answer

Have Sub run upon WPF Start

I am looking for how to create a private sub to load data from a txt file into some textboxes and the run a message box asking the user if the loaded data is correct. I haven't figured out to access the form_load or start_load of a WPF yet after…
LordDaius
  • 53
  • 1
  • 3
  • 8
3
votes
3 answers

visual c# code to load the Form1 again

In my Visual C# program I have 2 forms call Form1 & Form2. Form1 has a button call btnfrm1 and Form2 has a button call btnfrm2. What I need my program to do is :- When I press the btnfrm1 it need to open Form2 and hide the Form1 & when I press…
3
votes
1 answer

form_load subroutine in MS Access VBA

I am writing a code in MS Access VBA, which is as follows: Private Sub Form_Load() MsgBox "loggedIn = " + CStr(loggedIn) If (loggedIn = 1) Then Else Exit Sub End If End Sub I want to decide whether to load the form or not…
Jay
  • 1,210
  • 9
  • 28
  • 48
2
votes
0 answers

At what point in the Form Load are the Controls created in C# and Visual Basic?

I am migrating a project written in Visual Basic to C#. During the Load of a Form in VB I execute a function that uses the Controls of said Form and it works correctly. However, when running the same function during Form Load in C#, the function…
2
votes
1 answer

UltraWinGrid Auto Refresh

In my vb.net project, I have 3 forms. home_mdi, Viewfrm and AddDatafrm. Viewfrm has an UltraWinGrid on it, which is displaying some data. When I click the add data button, AddDatafrm opens. When data is saved, the form then closes. At this point,…
David
  • 2,298
  • 6
  • 22
  • 56
2
votes
4 answers

Confusing in event Form_Load

private void Form1_Load(object sender, EventArgs e) { MessageBox.Show("Luanching.... This may take a few second"); ............ } Here if I don't click OK in messagebox my from will not show up (It will wait until me click) how to…
Zen3515
  • 309
  • 4
  • 12
2
votes
2 answers

Display an ascended value in a combobox on form load in Access (default value)

So on a form I have, I'm using a combobox (unbound), with the row source being linked to EntryID, which is being pulled from a different table. Currently, EntryID has values 1 to 300, with 1 being the oldest entry and 300 being the newest entry…
Muhnamana
  • 1,014
  • 13
  • 34
  • 57
1
2 3 4 5