473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Value and Text Change Events - help please

Following the initial load of data into bound controls as my form loads , I
want to detect when a user have changed the value of one of the Combo or
text box fields etc This will allow me to test the bDataChanged variable and
warn the user that data has changed if they attempt to close the screen
without saving.

The problem I have is that I can't reliably set bDataChanged to False
immediatly after the Initial load of the form as the DataChange event seems
to fire again when the Me.ShowDialog(frmOwner) is executed.

I'm doing my initial display and capturing the data change event with the
code given below:-

Suggestions as to what I'm doing wrong would be appreciated.

Thanks

Andy

Public Sub Display(ByVal frmOwner As Form, ByVal iVehicleId As Integer,
ByVal iGroupId As Integer, ByVal iCompanyId As Integer, ByVal iBranchId As
Integer, ByVal iCostCentreId As Integer)

Try

UnBindControls()
'Vehicle Details Objects
Dim _VehicleBLL As New AmcNet.BusinessLogic.Vehicle
_Vehicle = New AmcNet.Info.VehicleInfo 'new
_Vehicles = _VehicleBLL.GetVehicleById(iVehicleId)
_Vehicle = _Vehicles.GetValue(0)
LoadDropDowns()
BindFields(_Vehicle)
LoadVehicleListView(iNotificationGroup, iNotificationCompany,
iNotificationBranch, iNotificationCostCentre)
HighlightSelectedRecord(_Vehicle.Registration)
bDataChanged = False ' Reset As This will be True after initial
Data Load
Me.ShowDialog(frmOwner)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Private Sub DataChanged(ByVal sender As Object, ByVal e As System.EventArgs)
_

Handles txtRegistration.TextChanged, _
txtNotes.TextChanged, _
txtCCRating.TextChanged, _
txtCCRating.TextChanged, _
txtLeaseSupplier.TextChanged, _
txtModel.TextChanged, _
cboBodyType.ValueChanged, _
cboClass.ValueChanged, _
cboMake.ValueChanged, _
cboOwnership.ValueChanged, _
dtpStartDate.ValueChanged, _
dtpEndDate.ValueChanged

bDataChanged = True

End Sub
Nov 22 '05 #1
0 1466

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
0
by: AndyDunning | last post by:
Following the initial load of data into bound controls as my form loads , I want to detect when a user have changed the value of one of the Combo or text box fields etc This will allow me to test...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
2
by: epigram | last post by:
I'm responding to a button click event on an asp.net web form. I then need to retrieve the value from a TextBox control and I want to compare it against the control's previous value to see if it...
4
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once...
2
by: Kevin Hodgson | last post by:
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property. When a user makes a new selection in the...
8
by: Radek Budař | last post by:
Hi all, i have trouble with changing text value of textbox on runtime. I use this control to display process information about sending e-mail per smtp. I use external component >>Imports...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
2
by: John Smith | last post by:
Will this line of the code: item.Cells.Text = "Some text..."; change only DataGrid visual value or it will also change value in the DataSource? How can I change value in DataSource? ...
2
by: duancg | last post by:
Hi, I wonder if someone could help since I wasn't able to find the answer through search. I have a simple .aspx page that shows data from a database table, as a table in UI. Now the data uses...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.