Forms :: Close A Module In A Multiform Program?
Nov 26, 2004
I have a quick VB.NET question.a) How do I close a module in a multiform program.I tried Me.Close() but it says it can't use it in modules.b) How do I control little red X button on forms? What if instead of closing the program I want to hide the form when the user presses on red X in the top right corner?
View 7 Replies
ADVERTISEMENT
Sep 20, 2011
I've been trying to use a custom cursor in my program that has 4 forms and a module.
-Module-
Public Declare Unicode Function LoadCursorFromFile Lib "user32.dll" Alias "LoadCursorFromFileW" (ByVal filename As String) As IntPtr
Public MYDoc As String =
[Code]....
I used this thread to figure out how to do this:
[URL]
The custom cursor is indeed a cursor file (*.cur)
View 5 Replies
Oct 5, 2006
I made a project on vb.net.Im working with multiple forms.Now,from the main form, I activated the 2nd form.then hide the main form. My problem is when I directly close the 2nd form, my project is till running.I closed it trough the "Close Button" of the form.Any way i could interact with that so I could go back to the Main(first) form when i close it there.
View 6 Replies
Jan 18, 2010
how do you close a program if it has multiple forms? Me.close doesn't seem to be
working...
View 1 Replies
Dec 3, 2011
this might seem a fairly stupid question to ask, but how do you use a Button to close all forms and end a Program?
View 4 Replies
Feb 23, 2011
I have a method where I am making a trial period. When the date has exceded its trialperiod the program will not close.
The code looks like this:
Public Sub DemoRestrict()
If My.Settings.dteStartDate = Nothing Then
My.Settings.dteStartDate = Now
End If
If My.Settings.intTime = Nothing Then
[Code] .....
Why does the form not close? Is just runs to the next method in the load sequence.
View 1 Replies
Nov 16, 2009
Basically we're creating a multiform app for class with 3 different forms. its going to be a game.
My startup form asks only for your name and your total units to play with. Then you're able to click a play button, which opens up a new form that will display your total units available (from the first form) and allow you to enter how much you wish to wager for that round.
I wish to know how to pull the info from my textbox (txtUnits) on the first form (frmWelcome) and have it show up in a label(lblCurrentGameStake) on my second form (frmMain).I thought about maybe putting the value in a string and then calling that on my second form but it doesn't work. Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
strStake = txtUnits.Text
[Code]...
View 7 Replies
Mar 4, 2011
In a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another
View 5 Replies
Aug 30, 2009
my web browser is my main form and it has a number of sub forms , how can i set it that when i close the main form my sub forms dont close ?
At the moment when i close the main form all the forms close
View 2 Replies
Mar 2, 2009
I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.
Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click
Dim f As New frmOrder3
[Code].....
View 1 Replies
Dec 13, 2009
Im running a program with multiple forms with a menu and toolstrip defined and assigned with properties in a module. each form has the Call menuload (Me) in the form_load sub.
My problem is that these menu's have menuitems which need close the shown form and open another. a sample of one of my menuitems is:
Module MenuTemplate
Friend WithEvents frm As Form
Friend WithEvents menustrip As New MenuStrip
[Code].....
View 14 Replies
Apr 21, 2010
i have a problem with trying to get 2 forms to close at different times using a timer on each of the 2 forms.
This is my form layout:
Quote:
frmMain
Frm1
Frm2
Frm1 and Frm2 are identical to each other. FrmMain has 2 buttons on it. One button to call Frm1 and the other to call Frm2.Frm1 and Frm2 each has a timer. It counts down to 0 and then does a .close(). However, if i pause between clicking the second button they both seem to always disappears at the same time.I would do something like this...
Click on the first button (showing the Frm1 form)
wait about 10 secs...Click on the second button (showing the Frm2 form)they both are shown on screen...hen they both disappear at the same time.... which shouldn't happen since i clicked the Frm2 box 10 seconds AFTER Frm1... So Frm1 should hide before Frm2 does...but it does not.
[code]....
View 6 Replies
May 3, 2011
I'm trying to declare a array that I want to use in the module and in the forms. I like it to be usable all over but I cant get it to work.I tried this code but when I want to use it in the module it says that it isn't declared.
Code:Public Class Form1 Public ShuffleArray() As String Anyone know what I should do to make it work?
View 4 Replies
Apr 16, 2009
I have two forms frmMain and frmNew, and one module modMain. In modMain I hold public variables which are needed for application. My question is how to open and close those two forms when needed? I ask this because if i set frmMain as startup form, then when closed, application will end, and one of those two forms will always be displayed. Also if I set frmNew as startup form, then when I close this form, application will also end. Is there a way to do this from module or something so my application won't end after closing and opening any of those two forms?
View 2 Replies
Apr 21, 2010
i have a problem with trying to get 2 forms to close at different times using a timer on each of the 2 forms. This is my form layout:
[Code]...
View 6 Replies
Jan 31, 2012
Ok im failing at this. Im trying to get all my forms on one project to read my Module. I need them all to read because of the way im building it. Im trying this code but it dosent seem to be working.
[Code]...
Y can i not link my form and button type of that form to that code? Do i need to use a differnt Sub or what?
View 1 Replies
Feb 11, 2009
I am new to the forum and new to the visual studio set up and have been working at a practical at home and have ran into some difficulty. The notes say that I am to declare several module variables below the section entitledI have the rest of the form complete but have been unable to locate where I am to place this code
View 1 Replies
Apr 12, 2012
I'm building a apps that which allow to check the room availability for a hostel.I am looking some controls which is similiar to the following which allowed me to change the color of the box during runtime.
View 10 Replies
Feb 9, 2009
I have two forms . each form has a text box. if i type something in first text box, and click next button, it has to show up on the second text box which is on the second form. how would i code this, or how can i use a module?
View 5 Replies
Jun 24, 2011
i have 2 forms and i want buttons on form1 to tell a label on form2 different numbers. ( if button 1 is hit then label.text = 15, if button 2 then .text = 20 ect)
and i also want a variable to make it so that every time i click the number goes down by one.
ive been reading on google and in vb6 you would use a module but ive read mixed things on google that i could use a class or a module. So i started testing with a module saying
Public a As Integer
For a = 1 To 30
a = a - 1
[Code]....
how to start a module and link it to other forms?
View 1 Replies
Jan 3, 2012
I am trying to access a browser control in one of my forms from a module but keep getting an error. I attached a screen capture showing the code and the error balloon. The subroutine is public, and I am addressing the browser correctly. If I copy that same code into the "Main" form, and it works perfectly.
View 3 Replies
Dec 11, 2009
Im running a program with multiple forms with a menu and toolstrip defined and assigned with properties in a module. each form has the
Call MenuTemplate (Me) in the form_load sub.
My problem is that these menu's have menuitems which need close the shown form and open another. a sample of one of my menuitems is:
[Code]...
View 2 Replies
Sep 2, 2011
I am making a program that NEEDS to be password protected, so i made a textbox with a code so that when the user enters the right password it lets you in. But if the user/person enters a wrong password 2X it will kick you out. So is there a way to keep the
View 3 Replies
Feb 26, 2012
I 'm a beginner and have a project that I'm using to turn lights on and off. I need to use separate forms for display on remote monitors. My problem is each form needs the same serial port open to work and the port won't open unless it's closed in the previous form. Using a module works for opening and closing the port, but only for one round. If I try to revisit a form I already accessed it doesn't work.
Public Sub sp1(byval SerialPort1)If Form2.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form3.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form1.SerialPort1.Open() end sub
Public Sub sp2(byval SerialPort1) If Form1.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form3.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form2.SerialPort1.Open() EndSub
Public Sub sp3(byval SerialPort1) If Form1.SerialPort1.IsOpen = TrueThen Form1.SerialPort1.Close() If Form2.SerialPort1.IsOpen = TrueThen Form3.SerialPort1.Close() Form2.SerialPort1.Open() EndSub
end Module
View 2 Replies
Mar 17, 2010
Have a label on a form which I want to show run time status, and have a code module which stores some functions. How do I send text from code module functions to this label on form?
View 2 Replies
Jul 8, 2011
the project uses a submain as startup object which is located in a module, thy so the application will be started in tray. Within the main() event i need to deserialize a xml file and with it set the properties of a class and then set what the application will do.The problem is, after I deserialize it and put set the property values I try to get them in the same event(main) but when it gets the value it returns as nothing(if string) or 0(if integer) but in the debugging i saw it setting the values. Is there a way to do that, within the main() event of a module to set the properties of a class and then get them without being nothing/0 ?
View 3 Replies
May 2, 2010
I have a Main Module that loads a form. I want to update text on a Label, my code is:
Public mFormSplash As Form = New FormSplash
Sub Main
With mFormSplash[code]....
The code loads the form OK but does not update the Label's text (LabelStatus)I am getting an error Error:
'LabelStatus' is not a member of 'System.Windows.Forms.Form'.
This worked ok on a previous project and I can't work out what is different.
View 6 Replies
Feb 25, 2010
If e.CommandLine.Count > 0 Then
Dim IncomingCommand As String = e.CommandLine.Item(0).ToString
If IncomingCommand.Substring(0, 2) = "-1" Then
form1.close()
End If
End If
I am trying to make the program close if the -1 string is sent with the program. See my installer allows for me to run certain programs before it actually installs, but it doesn't shut down copies of the program itself. So I have a next startup instance set to shut the program down if the -1 is received. But if the program is not running it starts up instead. This is not desired. form1.close doesn't work. e.cancel = true doesn't work, etc etc. What can I do to make the program not start during this instance.
View 1 Replies
Jun 22, 2010
I was a vb6 user, done a few projects only with forums Now i am moving to vb.net(vb2010) and i have some trouble.Lets say we have a form(form1), a module(mod1) and a textbox on the form1.
i want to start a Sub (DoWork) in the module but in a new thread.
Dim Thread1 As System.Threading.Thread
Thread1 = New Threading.Thread(AddressOf mod1.DoWork)
Thread1.Start()
The DoWork sub does some stuff and when it's finished i want to change the text of a textbox1 in the main form and start another sub (DoWork2) on the main form under the main thread not the one DoWork is running under.
Plese do not refer me to another post that mighe give me a part answer, try to explain to me what i have to do and why.
View 3 Replies
Oct 19, 2010
How can i close all forms I use wpf vb 2010 To load other form i use like Private frm As MainWindow = New MainWindow to open the window i used frm.Show()and to close it i use frm.Close()Now I have two forms like form1 and form2 I want to open form2 when i click on the button - ok it's easy The Question How can i closed form1 from form2 when i open form2 using button when i user Private frm As form1 = New form1 frm.Close() It like a cricle and can't closed
View 2 Replies