.net - Reverting A Form To Its Orignal Values?

Mar 4, 2011

So I am trying to code a cancel button that when it is clicked, will revert the changes made to the form and then close it. One idea that I had was on the form load event declare variables to store original values. However since that would involve declaring them as global, I did not want to go that route. With that said my question is: What is the best way to revert changes to a form without having to declare a bunch of global variables. Since i was storing all these form's control values into My.Settings, all I needed to do was use

[Code]...

View 4 Replies


ADVERTISEMENT

Values Reverting After Function Call

Jun 16, 2009

I have two files. My form and a module with helper functions and the definition for a structure. For some reason, when I call finish_up, which should calculate how much freespace a disk has, the values just revert to their original bytes value. However, if I put a msgbox inside the function, the correct information is displayed. Just not once it goes back to the form.

Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Disks As New List(Of DiskData)
Search_Disks(Disks)
Finish_Up(Disks)
For Each x As DiskData In Disks
[Code] .....

The finish_up sub should go through each diskdata structure, find if it isready, calculate freespace and size down to their proper amounts and then just send it back. I don't understand where the problem is.

View 2 Replies

Text Boxes Reverting To Pre-edit Values?

May 15, 2010

I have written some code to get the data from a number of text boxes all named in the style txb_[column name]

I want to write this data to a datatable.

The text boxes were initially filled using a row 'aIndex' from the datatable, then the user can edit the data.

When this code runs, the text boxes all revert to their initial values, regardless of any changes made to their contents during runtime.[code]...

View 1 Replies

C# - DataGridViewComboBoxColumn Value Member Keeps Reverting To (none)?

Jun 21, 2012

I'm trying to set the ValueMember property on a ComboBox column of a DataGridView, from the designer in VS2010.Every time I set the value, at the moment of leaving the cell, it revert to (none).Same thing happens with the DisplayMember property.

View 1 Replies

Datagridview, Reverting A Value That Is Changed In A Cell?

Aug 9, 2011

i'm using vb 2010 to write a program for my school. i'm asking the teachers to key in their student's curricular activities into a program through datagridview. i manage to restrict the code they enter by validating it in the datagridview cellvaluechanged event handler. my idea is as follow.

1. teacher enters code in the datagrid.

2. vb check the the value and if it is in the database then update. if not then give a preset value "-1" as no record.

these are my code...

Private Sub DataGridView1_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
Dim Cn As New ADODB.Connection

[Code]....

my problem is... is there a way so that when the teacher enters an INVALID CODE and leaves the cell by mean of pressing "enter" or by clicking at other cells, the cell edited before is remain focused and the value before is revert back?

View 4 Replies

DB/Reporting :: SQL Select Query In Form - Form With A Datagridview That Displays All Of The Values

Mar 26, 2008

I am using VB2008 Express and a MSSQL Server 2005 db by the way! I have a comprehensive SQL statement, which should fill my Grid:

DECLARE @Sum NUMERIC(9,2)
SELECT @Sum = SUM(I_LS.lmenge)
FROM dbo.lfs AS I_L

[CODE]...

Now here is my problem! I want to have a form with a datagridview that displays all of the values I am querying. This shouldn't be a problem I guess. However, I have no idea how I can integrate two textboxes that can be used to enter the selection criteria (WHERE I_L.lfsnr LIKE '%1253') AND (l.sped_journal = '11-08')[/SIZE]. I have googled and read many threads so far but didn't stumble upon anything that would suit my needs and answer my question. Maybe it's just too elementary!? By the way, it is very important that the input of textbox1 ((WHERE I_L.lfsnr LIKE '%1253')) is linked to 3 positions in my SQL query to define the search criteria!

The worst thing is that I don't want to have a bindingnav displayed! I do not need any delete, update or add functions just the select option, however!

View 1 Replies

VS 2010 Display Pdf File Inside A Form That Gets Some Values From Form Controls?

Sep 27, 2010

Inside a form, I would like to display a pdf file which is already available in my resources (template file "untitled"). In this pdf file, I have some fields which get their values from some texboxes in another form. My aim is, when the user triggers the button to call this form, it should insert the values inside the pdf file and display the output pdf inside the form.I have written the code to an extend but could not finish it myself after my many trials... Now here are the two things I cannot manage:I can use a directory to read the template pdf "untitled1.pdf". But my aim is to use the file inside my resources. can save the output file in a directory but this is not I want to do. I want to display the output pdf.

View 1 Replies

C# - Update And Get Values In Windows Forms While Moving One Form To Other Form?

Nov 30, 2009

How can I update and get values in a Windows Forms application while moving one form to other form (like cookies)?

I need to update the values to some variable and again I am going to refer stored values and need to do some calculations.

I have used cookies in ASP.NET but I am not able to find out the same concept in .NET Windows Forms (C#).

How can these issues be resolves?

View 4 Replies

Getting Parent Form's Property Values In A Child Form

Feb 20, 2012

I have a custom form that I use instead of msgbox for a number of reasons. The initial reason was to keep the message centered on it's parent rather than the screen. There are many articles about this but I still have not found an elegant way to get access to the Parent's properties from inside the Child without passing them in (by one way or another).

In the child form the me.parent, me.parentform are not instantiated and apparently can not be used.

The point is to have this form be totally encapsulated with the logic being self contained. This is not an MDI child, and I do not want it to be due to the limitations on MDI children.

My current workaround looks like this I use a ShowMsg Function in my MyMsgBox form which looks like this:

[Code]....

View 6 Replies

Load The Combo Box'values From One Form To Another Form's Combobox?

Nov 15, 2011

how to load the combo box'values from one form to another form's combobox

Example:

form1:
cust(table name)
no(textbox)

[code]....

now i load the form1's name which is the combo values .. to form 2's combo box whixh is name of 'CName'

View 2 Replies

Passing Values From Modal Form To Parent Form?

Aug 11, 2011

I am trying to pass information to parent form from modal form in vb.net winforms application.

1.) I created a copy of a form and displayed it using following code.

dim f=new frmParent()
f.show()

2.) Depending on conditions a button on frmParent opens a modal child form and asks for some informations. I used following code for that:

dim f = new ChildForm()
f.showDialog()

Both code works fine. When user press saves in child form i need to close childForm and use the user types values in parent form. I know how to close the childform but not sure how to pass info from childform to parent form.

View 1 Replies

Pass Values Form To Form?

Sep 11, 2010

I know this has been asked, but can someone look this over. I have been going over and over this for about 3 days now. In my main form(frmBuildings) I pass a value to frmCustomerInformation like this.[code]...

View 3 Replies

Transferring Values From Form To Form?

Jan 16, 2010

Im having a problem when transfering values from form to form.Firstly I have a main menu form,click on a button to go to the dell components form.I choose the components for the computer and when i hit calculate the total is displayed in a textbox for my subtotal. When i press send it will send the sub total from the dell components form to the grand total and display it in the dell sub total in the grand total form.This part works ok, however, i go to the main menu and click on a button to go to the packardbell components form. Do the same again but when i press send, it will send the value to the grand total form in the packardbell sub total textbox but the value in the dell sub total textbox has vanished.Here is the code in the dell components form

Code:
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim frm As frmGrandTotal = New frmGrandTotal(txtDellSubTotal.Text)
Me.Hide()[code].....

Finally, the other problem im having is on the main menu form when I click on the view total button I get this error: Here is the code for this bit

Code:
Private Sub btnViewTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewTotal.Click
'frmGrandTotal.Show()
Me.Hide()
End Sub

View 5 Replies

VS 2005 - Form Load - Retains The Previous Values During The Form Load

Jul 27, 2009

Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim con As OleDbConnection
Dim cmd As OleDbCommand


[CODE]...............

The insertion part of the form works great. But my problem is in the form load part......If i leave a field blank(Null),then perform Save operation,close the form after successful insertion and then reopen the form,then it retains the previous values during the form load......This is only in case where i leave a field blank in the previous data entry in the database.......But if i enter values in all fields then form load is working great.

View 2 Replies

Asp.net - Retrieving Form Values From VB?

May 5, 2009

I've created a module for my website and when a button is clicked, it calls a VB sub on the server.

I need this sub to retrieve the values that were filled in on the form, but the things I need to retrieve values from are not asp controls, they are simple <input> and <select> tags.

How can I retrieve values from input on a .aspx page from VB code executed behind it?

View 3 Replies

ASP.net Form Not Passing Ddl Values

Dec 9, 2011

I have a form with 2 dropdownlists and a submit button. I want to pass the values of the lists in a URL when the list is submitted but for some reason the initial value of the ddl is getting passed. Here's my code:

[Code]...

View 2 Replies

Bring Values From One Form To Another?

Apr 7, 2011

How do you bring values from one form to another? Ive a car price which i need to carry over to another form as i have check boxes which if selected will change the price.

[code]...

View 4 Replies

Bringing Values From One Form To Another?

Apr 7, 2011

How do you bring values from one form to another? Ive a car price which i need to carry over to another form as i have check boxes which if selected will change the price. How do i solve this?

View 20 Replies

Get The Gridview Values In Next Form?

Sep 7, 2009

how to create in many buttons and with events in runtime

how to get the gridview values in next form

View 1 Replies

Passing Values From One Form To Another?

Jun 22, 2010

i have a listview control on form1. I want to send the selected value to form2.

I tried couple of ways but nothing seems to work correctly.

View 6 Replies

Retrieving Values From One Form To Another?

Jan 15, 2012

I have two forms
-DoctorAppointment
-DoctorSchedule

the DoctorAppointment form has all the details about the doctor and the patient and one Schedule button which will show the DoctorSchedule form When I click on any value in the DoctorSchedule form like Monday or any other day and click on save button it opens a new DoctorAppointment form and store the Day value in the text box of the form. The old DoctorAppointment form stays as it is but the new DoctorAppointment form that appears after DoctorSchedule Save click it removes all the earlier values (doctor and patient Details) that were present on the DoctorAppointment Form.

I want that after the Save click it should not call any new form instead the Day value should come on the old form including the Doctor and Patient Details.

View 6 Replies

Values Are Not Populating In The Form?

Oct 13, 2011

Using VB.Net (Windows Application)In the form (called as FirstForm), i am using textbox, add-form Button, search button.When i click the add-form button, it will give the new form (same as FirstForm)Code for adding new form

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim SecondForm As New FirstForm
SecondForm.Show()
End Sub

Search Button Code

Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click
If FirstForm.Focus = True Then
FirstForm.textbox1.Text = gridview1.Rows(crRow).Cells("code").Value.ToString().Trim()

[code]....

The above code is working, but If i am in second Form when i click the search button and selected the value, then the value is appearing in the FirstForm textbox, it is not appearing in the SecondForm textbox.If SecondForm is showing, the selected Value should appear in the SecondForm textbox not in the FirstForm Textbox.

View 2 Replies

.net - Auto Update Of Values In UI WPF Form?

May 6, 2012

I have a class as follows:

Public Class BillAmounts
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged

[Code]...

However, the issue is that TOtalAMount is getting updated automatically but FinalPrice is not getting updated. Any reasons/mistakes I have done. I have tried it a lot in few ways but could not get that working. What i did not understand is that Total amount is getting updated but Final price isn't.

View 2 Replies

.net Autoschedule Windows App With Form Values?

Oct 13, 2010

I have a need to schedule an application for auto run.

The problem: I need to pre-populate the form and retain those entry values to be used at run-time.

Anyone have any ideas or suggestions on how this can be accomplished?

View 1 Replies

Assigning Values To Variables From Another Form?

Dec 3, 2011

I'm passing a value to another form and later on use that value that is assigned to a variable.

Here is the code.
loadingPage.Show()
mode = "notime"
Dim ld As loadingPage

[Code]....

CurrentMode doesn't have a value. I don't know why. CurrentMode is a global variable.

View 6 Replies

Calculating Values On A Form And Rounding?

Aug 6, 2009

With the application i'm building i have to do some calculating, ive so far not had to do anything like this so i could use some pointers. Here's the simplist of calculation i have to do, if i could get some help pointing me in the right direction i could probabaly figure the rest out.

It would be Box1value * box2value / 144 = box3 But if box 3 returns a value of less than 2.5 it rounds up. The rounding function is very important to subsequent calculations i will have to make.

So the this simple form would work where the user inputs a number into box one and two and the calulation appears in box 3. Attached is a mockup of the form design.

View 6 Replies

Change Values In All The Objects On Form?

Apr 24, 2009

I am trying to change values in all the objects on my form.

First off I call my function when the form loads

SetFonts(me)
Public Sub SetFonts(ByRef Frm As Form)
For Each Ctr As Object In Frm.Controls

[Code].....

View 3 Replies

Change Values Of Listview From Another Form?

Feb 20, 2010

How do I automatically update the values of a listview in form 1 with the values inputted in form 2? I've already declared a few global variables.

View 2 Replies

Designing Form And Trying To Get Different Values For Different Controls

Feb 15, 2012

I'm designing a form and trying to get different opacity values for different controls. How should i do it??eg. clear visible text floating over 50% opaque form.

View 6 Replies

Different Values Of Combobox On The Multi Same Form?

Mar 26, 2010

Is possible to have different values of combobox on the multi same form?

Actually I want to make a multi same form, but with one combobox to set the authority. When different persons to use this same form, I will have different selection limited on this combobox,

View 4 Replies







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