Problems with TextBoxes

Sep 13, 2007 at 3:43 PM
Hello Everyone,

I wrote a project with two views. In the first view I want the user to write a number in a textbox. When he clicks on a button, the second view should open and write the number in another textbox( label, whatever).

I tried to write a method in the ModuleController module from the business module but I can't use the attribute textbox.Text from the textbox in the view-folder.
I think it is a problem with the architecture but I dont know how to solve this problem.

Thanks for helping,

hauke
Sep 13, 2007 at 3:47 PM
another add:

Where must I create the method?
Sep 13, 2007 at 7:43 PM
Edited Sep 13, 2007 at 7:44 PM
View 2 should not be able to access View 1 directy. Assuming that the code that creates and shows View2 has access to the variable containing View1, this code should be able to access a Get Property on View 1 that returns the value from textbox.Text and passes this value to the variable containing a reference to View2. This also assumes that View2 has a Setter Property, such that when set, the value of View2.textbox.Text is set.

This is not a problem with the architecture, but most likely a mis-understanding of the MVP pattern.

An alternate approach would be to put the values from View1 into some sort of state / caching mechanism. But this is an entirely different topic.
Sep 17, 2007 at 9:31 AM
Edited Sep 17, 2007 at 10:09 AM
..I cant really use the variable in the same view. I cant see the problem at the moment. The variable is declared automatically in the view.designer.cs.
In the view.cs-class I cant use the variable. What do I have to do to make the varible accessible at least in the same view?


now I restarted Visual Studio and I havent the problem anymore..

Thank you