473,405 Members | 2,294 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,405 software developers and data experts.

Interdependent controls :TextBox

Hi,
I've been playing with VBx and VB.NET for a while
now but ...

Let say in VB.Net, I've never understood how or
which event I should use when I update one of two
interdependent textboxes.

Let say I've 2 textbox : TB1 and TB2.

TB2 depends sometimes of TB1.

TB1 may be modified by the user.
If so TB2 must take TB1 value, if boolean B1 is
true, else TB2 is unchanged.

TB1 may be set within VB code, then TB2 mustn't
change.

So here's my questions :

1) Where could I find informations on how to
manage interdependent textbox ?
2) Which event would be thrown if it's the user
who have changed TB1?
3) Which event would be thrown if the changing
was done within VB ?
4) How can I make the difference in VB ?
5) Is there a way to turn off events, so in code I
could say "Don't bother with "changed"
events for the next few instructions?

Thanks for any helps,
Paul
Nov 21 '05 #1
1 1595
Paul,

You ask something that is mostly a cruel and where you can use the event
"value changed from both textboxes". However be aware not to create an
endless cycle.

Something as using two textboxes where
textbox2 = 10 times textbox1

When you let the user change both textboxes, will need that you do
something in both events (rougly typed just as idea)

In the event of textbox1
\\\
if CDbl(textbox2.text) <> CDbl(textbox1.text)*10 then
textbox2.text = (Cdbl(textbox1.text) * 10).ToString
'this throws the value change event of textbox2
end if
///
In the event of textbox2
\\\
if CDbl(textbox1.text) <> CDbl(textbox2.text)/10 then
textbox1.text = (Cdbl(textbox2.text) / 10).ToString
'this throws the value change event of textbox1
end if
///

I hope this helps?

Cor
Nov 21 '05 #2

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

Similar topics

9
by: wASP | last post by:
Hello again to all of you geniuses, I'm having a problem trying to load dynamic controls at the initialization phase. I've read the docs, and I thought I had it figured out:...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event....
7
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls...
3
by: Mike Collins | last post by:
I have some controls that I am creating dynamically. After the user finishes entering their answers in these controls, I would like to iterate through these controls and get the answers out. I have...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
0
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event,...
8
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a...
4
by: Joergen Bech | last post by:
Just out of curiosity: What is your favorite method of making sure that anything that happens on a form, only happens in response to a single, external event? Take the example below. I have made...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.