473,320 Members | 1,900 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,320 software developers and data experts.

How can dynamic controls access static controls?

Hi, I have a desktop application that uses an array of dynamic
buttons in a class. I would like on button-click to change the text
in a static text box on the form. The problem is that that when I
click on the button, the code that runs is in the buttonarray class,
not in the form. From within the class I have no access to the static
controls that are also on the form.. Does anyone know how to get
around this?? thanks for you help
Nov 20 '05 #1
7 1027
there is probably an other way to do this but this should work

declare your form as a public shared var of that form
now you'll have access to the formvar.textbox

hope it helps

eric

"Fred White" <fr*******@hotmail.com> wrote in message
news:87**************************@posting.google.c om...
Hi, I have a desktop application that uses an array of dynamic
buttons in a class. I would like on button-click to change the text
in a static text box on the form. The problem is that that when I
click on the button, the code that runs is in the buttonarray class,
not in the form. From within the class I have no access to the static
controls that are also on the form.. Does anyone know how to get
around this?? thanks for you help

Nov 20 '05 #2
* fr*******@hotmail.com (Fred White) scripsit:
Hi, I have a desktop application that uses an array of dynamic
buttons in a class. I would like on button-click to change the text
in a static text box on the form.


What is a "static text box"?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Hello Herfried,

What is a "static text box"?


I wished I could answer it for you, but I think it is something as a label.

:-)))))

Cor
Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
What is a "static text box"?


I wished I could answer it for you, but I think it is something as a label.


Or the OP is referring to a variable marked as 'Static'. I don't know.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
i think he means
dynamic = added at runtime
static = added at designtime
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Cor" <no*@non.com> scripsit:
What is a "static text box"?
I wished I could answer it for you, but I think it is something as a

label.
Or the OP is referring to a variable marked as 'Static'. I don't know.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
* "EricJ" <ericRéMo**@ThiSomnipack.be> scripsit:
i think he means
dynamic = added at runtime
static = added at designtime


Thanks. The 3rd interpretation.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
On 4 Dec 2003 06:49:13 -0800, Fred White wrote:
in a static text box on the form. The problem is that that when I
click on the button, the code that runs is in the buttonarray class,
not in the form. From within the class I have no access to the static


Is the buttonarray instantiated in the form? If so, you need to pass a
reference to the form into the buttonarray. Perhaps you can overload the
buttonarray's constructor to take a reference to the form. Then the button
array would be able to access the form's properties.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #8

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

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
3
by: Robert Mark Bram | last post by:
Hi All! Has anyone seen an example of the following javascript powered control: - a dropdown select menu - the width of the control is set. Assume by "control" I mean the visible part of the...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
1
by: hybrid | last post by:
I have problems in understanding the behavior of the events triggered by dynamically created controls over a webform. Could you help me? In a webform, I have a static PlaceHolder PH containing...
4
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a...
8
by: George Meng | last post by:
I got a tough question: The backgroud for this question is: I want to design an application works like a engine. After release, we can still customize a form by adding a button, and source code...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.