Form Do Not Close When It Is Supposed To
Jun 7, 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
[CODE]...
Why does the form not close? is just runs to the next method in the load sequence
View 3 Replies
ADVERTISEMENT
Nov 8, 2011
HTML
Public Partial Class WebForm1
Inherits System.Web.UI.Page
Public num1 As Double[code]...
This is a part of a calculator code. When you press the button "BtnAdd" the text in TxtRes is held by the global variable "num1" and the operation number (whether add or subtract) by "oper". My problem is : OUTPUT 1: prints num1 = 25 (for example)While OUTPUT 2: prints num1=0
Why is this happening ? Isn't the value of num1 supposed to be equal everywhere in the form at a given moment ?
View 1 Replies
Mar 20, 2009
I have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.
Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:
vb.net
Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
[code]....
To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):
vb.net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show(Me)
End Sub
Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.
View 8 Replies
Jan 17, 2009
I have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?
View 2 Replies
Feb 12, 2011
sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function.
View 3 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
Feb 14, 2011
I try to transfer a vb6 application to vb2010. In the vb6 I start with a login panel that the user enter uid and password autenticate with the DBServer if ok show application main menu and close the login form. the order of the me.close() after the mainform.show() does not change, The application ends.
View 5 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
Mar 22, 2010
I am really new to Visual Studio and VB and I am having trouble closing a single form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
When I use Me.close() associated with this button it closes the entire project and not just the single form can anyone.
View 2 Replies
Jun 12, 2009
get a button on form A to open form B and then close (not hide) form A when clicked?Background: I am coding a VSTO application for Excel in VB2008.
Private Sub FormAButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles FormAButton.Click
Dim FormB As New FormB
[code]....
View 1 Replies
Jan 16, 2009
I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.
View 2 Replies
Jan 28, 2011
So, I'm making my program which let's people auto-update other programs. Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "UpdateFiles"
Label1.Text = "Finding updates..."'To do: Find all files in the folder, and let em update one at a time. Write names of Plugins to label2.text ProgressBar1.Maximum = 10000
[Code]...
View 8 Replies
Mar 2, 2010
I have a VB.Net project that I haven't worked on in awhile. I got into this morning and started to run it. I got some errors so I decided to step thru the code. I enter the Page_Load event of a Form module and execute a function call and it takes me to a "End Function" statement. Totally bypasses the function that was called. I continued to step thru it and it just took me randomly thru code. No order whatsoever. I believe I've had this happen before but don't recall how I fixed it.
View 5 Replies
Jun 25, 2012
I'm having lots of trouble understanding how repeaters are supposed to work and how I'm supposed to use them. Basically, I have a label, a set of image buttons, and a div within a repeater. When you click on the button, I want to populate the div that was created with these repeaters (so a different div for each iteration of the repeater).[code]I can't get the repeater to iterate. It's only firing off once and then stops. I can't get a label with the repeater data source's Subject (a field in my database) to appear.
View 1 Replies
Jan 17, 2012
I am making a program, but I need to make sure a file is at a certain place on a computer other then my own. How do I do this?
View 5 Replies
Feb 1, 2011
Using 2 objects of the same type, I'm trying to implement < and >, but I can't seem to find any authoritative source on what to do with either or both being Nothing. In other words what the accepted practice or MSDN suggestions are.[code]Accessors is my canonical method for centralizing an enumeration of the properties (all are decimal)return false for both if either is Nothing?I found a comment, but can't seem to verify or validate it that A null object is always less than a non-null object..
View 2 Replies
Jun 5, 2012
i am having some trouble in my Windows form application. i have 2 forms1st Main / Parent Form2nd Sub / Child Form (Menu)
View 7 Replies
Oct 28, 2009
I have been making a webbrowser for a while now, everything works well, except i am unable to make the 'open in a new window' button work right. So far i have managed to get a new instance of my form to open with the right url, but i am unable to keep that new form open when the orginal parent form closes.
Code:
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
e.Cancel = True
Dim Href As String
[code]....
View 2 Replies
Aug 25, 2008
I was playing around with designing a custom interface for a test application and I am using a custom image for a close button. I am using the FlatStyle properties to define it's look'n'feel. I've set the border to 0 but when the application loses focus, the border of the button shows up.I have tried to force the property to go 0 again when the application's "LostFocus" event is captured but doesn't work.I am also using a "rollover" method using MouseHover and MouseLeave events to change the image of the button.Using Visual Basic 2008 Express Edition.
View 1 Replies
Apr 3, 2012
My code seems to behave a way I don't understand. Sometimes it returns null as expected and sometimes it returns a value when its supposed to be null. How can someone explain this? Here is the code that selects from access and displays the result in a messagebox:
cmd5.Connection = cnn
cmd5.CommandText = "SELECT receipt_num " & _
"FROM brought_coffee, farmer where crop_year= " & yr & " and " & _
"brought_date=#" & dtt & "# and farmer_centre='" & ctr & _
[code]....
View 1 Replies
Jun 5, 2012
I am having some trouble in my Windows form application. I have 2 forms:
1st Main / Parent Form
2nd Sub / Child Form (Menu)
Problem:
I want to close my 2nd form (which opens on top of 1st form) when I click on the 1st form.
View 3 Replies
Sep 2, 2011
VS2010 VB.NET windows form app I have a login form that is my startup form.when uer hits OK I display the main form and close the login form, like this:
PrivateSub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
frmMain.Show()Me.Close()EndSub Problem is the application closes with me.close. Why? How can I close only the login form and leave the main form urnning???
View 3 Replies
Sep 4, 2009
When I use
Me.Close()
Form1.Show()
It closes the whole app.
How would I change it so that it only closes the current form while opening a new one? EDIT: I put [Not Resolved] Because I accidently pressed the resolved thing
View 8 Replies
Sep 16, 2011
I am trying to learn how to use the modulus operator.this excersise is a change calculator and is supposed to calculate the number of dollars , qtrs, dimes, nickels and pennies from the change that is calculated.
in the form if i put a value in for owed = 30.00 and paid 34.25 my dollars returned = 4 and that is correct but the number of qtrs = 0 and should be 1. I am not sure how to correctly use this - any assistance you can provide is great - this is purely educational
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim owed As Decimal
Dim paid As Decimal
Dim change As Decimal
[Code]...
View 8 Replies
Oct 22, 2009
creating an internet filter that is supposed to interface with web browsers, eg. Explorer, Chrome (not a web browser I made) and then block specific websites on the browser. I'm kind of lost on where I need to start with the interface. Could someone please just point me in the direction I need to go for 1) the program to work with any browser 2) For blocking specific sites.
View 2 Replies
Jun 22, 2010
My question is, the SelectedItem property of the Combobox is supposed to return a integer value, is it not? Because I am getting back integers, sometimes, then the next time through I get back a String. Has anyone else had a problem like this with the Combobox?
View 4 Replies
Apr 16, 2009
The form is an About Us form so has nothing on it only a text box and a OK button.
[Code]...
Why won't the button close the form? I'm puzzled, I tried another button just in case with the same result. UPDATE: I set a break point on Me.Close() and it isn't reaching it when I click the button, I created a new button and the same thing happened.
View 4 Replies
Jun 30, 2010
I am writing a GUI application to run on a touchscreen device using VB.NET and WPF--it must be full screen at all times, like a kiosk app; the window must not be able to resize or move in any way. The window contains a ListBox that users can currently scroll through by dragging across the list. The problem I'm seeing is that when the user drags across the list, the whole window moves a bit, exposing the desktop underneath, then springs back into place once the user stops dragging. I have not been able to figure out how to keep the window stationary while still allowing users to drag across the ListBox to view all list items. Here is a somewhat simplified version of my code:
[Code]...
View 1 Replies
Aug 24, 2011
I would like to know if there is a way to close a form when the user chooses to open some other form.
View 1 Replies
Jan 3, 2010
What I want is -
Dim filename = System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath.ToString)
Dim openForm As Object
[Code]....
View 4 Replies