Jump to content

Want textbox to override text in a separate form

Hi everybody,

 

I want the text entered in Form 1 to change text in Form 2.

 

Does this involve turning something from private into public?

 

It's a school planner, so I want the text entered into the main menu to edit the text in a separate form.

 

It goes like this:

 

Enter text into text box in Main Menu to name the school subject.

Separate form will have a textbox that gets the text entered from the Main form.

 

Thanks for any help in advance! 

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Well generally one would have some kind of model for the data. Alternatively one could obtain a reference to the second TextBox control and update it's text from either the TextChanged event on the first TextBox or on some cue such as a specific key press like enter for example. You'll need to be far more specific... i.e. by showing us your scenario.

 

On the whole I am saddened by the influx of Visual Basic related questions which all seem to be originating from education. I cannot stress this enough; while it will certainly provide you with object oriented principles it is very much seen as a dead language. Thus it has very little relevance to current industry. Moreover this would be far easier and more relevant still in WPF using MVVM over WinForms as again WinForms is seen as a decaying technology.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Well generally one would have some kind of model for the data. Alternatively one could obtain a reference to the second TextBox control and update it's text from either the TextChanged event on the first TextBox or on some cue such as a specific key press like enter for example. You'll need to be far more specific... i.e. by showing us your scenario.

 

On the whole I am saddened by the influx of Visual Basic related questions which all seem to be originating from education. I cannot stress this enough; while it will certainly provide you with object oriented principles it is very much seen as a dead language. Thus it has very little relevance to current industry. Moreover this would be far easier and more relevant still in WPF using MVVM over WinForms as again WinForms is seen as a decaying technology.

 

Yeah, I'd have to agree :(  Windows Forms seem pretty outdated for what I am trying to do....I was basically just messing around with it for fun, though, thankfully...school seems to be geared toward C# and Java I think, but I don't have those classes yet...

 

Thankfully I figured it out - I used My.Forms.Form2.... to use text from one form's textbox to replace the text in another.

 

Also, I tried WPF as well - I still need to cut my teeth on that one.  I was upset that I still needed to use a 3rd party library to change the color of the border...

 

I will gladly start looking into any IDE's and language you recommend!  This is basically all for fun and on my free time, although eventually it looks like school will be doing C# and java like I mentioned...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Yeah, I'd have to agree :(  Windows Forms seem pretty outdated for what I am trying to do....I was basically just messing around with it for fun, though, thankfully...school seems to be geared toward C# and Java I think, but I don't have those classes yet...

 

It's certainly good that you have come to that realization yourself so that you are at least cognisant to these concerns as you progress with it.

 

Also, I tried WPF as well - I still need to cut my teeth on that one.  I was upset that I still needed to use a 3rd party library to change the color of the border...

 

I'm not sure why you had to rely on a third party library to accomplish that... Things of that nature are usually achieved in WPF via the use of Styling and Templating.

 

I will gladly start looking into any IDE's and language you recommend!  This is basically all for fun and on my free time, although eventually it looks like school will be doing C# and java like I mentioned...

 

I would recommend that you look at WPF and the MVVM deign pattern, specifically in C#. Which given your forays into VB you should find that you are able to infer knowledge of quite comfortably. Furthermore learning MVVM in combination with WPF will provide you with very current industry relevant skills.

 

To provide a basic overview of what this is all about to get you started; Model VIew ViewModel (MVVM) is all about separation of concerns. You have your View (UI) which knows nothing about your ViewModel (the place where you put all of your business logic). Transversely the ViewModel knows nothing about the View. This means that the two have very loose to no coupling at all resulting in a very flexible and extensible architecture where one could quite easily change out the View for something else entirely without having to worry about the underlying logic. The same is true of the Model (i.e. your data store); it's also separated from both parts. Interaction between each component is achieved by the use of various abstraction patterns such as Data Binding, Dependency PropertiesDependency Injection, Inversion of Control (IoC), Service Locators and Interaction Requests to name just a few of the more notable ones...

 

There are some great libraries that supplement MVVM such as Prsim (for more complex applications), MVVM Light (good for mobile platform work) and MVVMCross which is quite new. These are of course just a few of the myriad that are to be found out there.

 

As for IDEs and ways of working I would say that Visual Studio with ReSharper, StyleCop and Power Tools provides a very solid development experience. I would hope that you are familiar with a form of Source Control such as Git, Subversion or Mercurial; Bitbucket is quite nice to use for personal work in that respect (I recommend Git).

 

I find Pluralsight and Lynda.com nice places to go to for learning. If you're interested Pluralsight has a great Design Patterns library and if you are really really interested they also have some very good Test Driven Development (TDD) courses here and here.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks so much!

 

I will dive into all of this....school hasn't been swamping me so this is great.  Thank you.  

 

What I am struggling with now is how to actually SAVE my published program.  From what it looks like, this involves BindingSource, which I know nothing about....I think this is partly what you touched on in some of the concepts in your post....

 

In any case, I think I will switch to C#...I actually have started looking at WPF too like you actually mentioned in another posted I asked help for....also, I will look into MVVM...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks so much!

 

I will dive into all of this....school hasn't been swamping me so this is great.  Thank you.  

 

What I am struggling with now is how to actually SAVE my published program.  From what it looks like, this involves BindingSource, which I know nothing about....I think this is partly what you touched on in some of the concepts in your post....

 

In any case, I think I will switch to C#...I actually have started looking at WPF too like you actually mentioned in another posted I asked help for....also, I will look into MVVM...

 

You are welcome. Yes BindingSource can be one way, there are many others of course. For example XML might be a valid choice for very simplistic data which would let you have some exposure to LINQ via LINQ to XML (also important to cover)  ;)

 

Good luck!

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Do you have a recommendation of what to look into as far as saving a simple desktop application?  It's a school planner - so, I would want the entire program to be saved, regarding the notes and scheduling info that I have placed in the program.  I would have a save and load button on the program, and be able to reopen it with all the information still there from the previous time it was opened...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Do you have a recommendation of what to look into as far as saving a simple desktop application?  It's a school planner - so, I would want the entire program to be saved, regarding the notes and scheduling info that I have placed in the program.  I would have a save and load button on the program, and be able to reopen it with all the information still there from the previous time it was opened...

 

What you want is something quite lightweight that can be packaged with the application. XML might be good enough for that. Alternatively SQLite might serve you better. Other considerations include NoSQL data stores. If you do go down the database route then you might want to have a look at the Entity Framework depending on the complexity of the data model.

 

What I would suggest is that if you are going for a library then it would be ideal to manage the dependencies though NuGet (integrated with VS).

 

How are you planning to distribute the application? For brownie points WIX is awesome for rolling MSIs ;)

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

What you want is something quite lightweight that can be packaged with the application. XML might be good enough for that. Alternatively SQLite might serve you better. Other considerations include NoSQL data stores. If you do go down the database route then you might want to have a look at the Entity Framework depending on the complexity of the data model.

 

What I would suggest is that if you are going for a library then it would be ideal to manage the dependencies though NuGet (integrated with VS).

 

How are you planning to distribute the application? For brownie points WIX is awesome for rolling MSIs ;)

Oh, this would be strictly personal use as a fun project running solely from my desktop...I would just need to be able to save it so I don't have to re-enter the school planning info all over again each time..

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

On the whole I am saddened by the influx of Visual Basic related questions which all seem to be originating from education. I cannot stress this enough; while it will certainly provide you with object oriented principles it is very much seen as a dead language. Thus it has very little relevance to current industry.

 

To say VB.NET is a dead language is a bit of an exaggeration. Support for it isn't going anywhere any time soon and you'll be able to find jobs for it for many years to come. But there's no denying that C# is beating it into the ground in terms of popularity right now and I don't see that changing any time soon either. 

  • Most sources I've read say that C# has more job offerings and a higher average salary. However, this doesn't necessarily mean it's hard to find employment as a VB developer or that you'll have a bad salary.
  • I also find that C# is better supported by the tools that I use for work (ex: ReSharper and Xamarin) but that doesn't necessarily mean you'll ever be effected.
  • I also like the fact that C# makes an easier transition syntax wise to C/C++, Java, and other popular languages. But once you learn to program, it's not that hard to switch around anyway.

Basically, if you want to "hedge your bets" it seems pretty clear that C# is the better option these days. I personally prefer C# but there's nothing wrong with wanting to code in VB so long as you are aware of some of the limitations that could exist. If you at all plan to stick around the .NET environment, it doesn't hurt to know both. Just pick one that you want to excel in. You never know what job opportunity will come your way in the future. For example, I'm employed and use both VB.NET and C# depending on the project I'm working on that day.

 

tldr: No need to hate :P

 

In any case, I think I will switch to C#

 

I hope you enjoy it, it's currently one of my favourite languages.

 

WinForms is seen as a decaying technology.

 

I certainly agree here though :P

Link to comment
Share on other sites

Link to post
Share on other sites

To say VB.NET is a dead language is a bit of an exaggeration. Support for it isn't going anywhere any time soon and you'll be able to find jobs for it for many years to come. But there's no denying that C# is beating it into the ground in terms of popularity right now and I don't see that changing any time soon either. 

  • Most sources I've read say that C# has more job offerings and a higher average salary. However, this doesn't necessarily mean it's hard to find employment as a VB developer or that you'll have a bad salary.
  • I also find that C# is better supported by the tools that I use for work (ex: ReSharper and Xamarin) but that doesn't necessarily mean you'll ever be effected.
  • I also like the fact that C# makes an easier transition syntax wise to C/C++, Java, and other popular languages. But once you learn to program, it's not that hard to switch around anyway.

Basically, if you want to "hedge your bets" it seems pretty clear that C# is the better option these days. I personally prefer C# but there's nothing wrong with wanting to code in VB so long as you are aware of some of the limitations that could exist. If you at all plan to stick around the .NET environment, it doesn't hurt to know both. Just pick one that you want to excel in. You never know what job opportunity will come your way in the future. For example, I'm employed and use both VB.NET and C# depending on the project I'm working on that day.

 

tldr: No need to hate :P

 

 

I hope you enjoy it, it's currently one of my favourite languages.

 

 

I certainly agree here though :P

 

I am basically open to everything...new to it all! :)  I would love to get an at home programming job, honestly, so I am open to any and all suggestions.....for now it's all training wheels to me...

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

-snip-

 

Please refer to this thread for my response :)

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

Please refer to this thread for my response :)

Very interesting...I am making the switch to C# soon.  My goal is to finish building this program (since I am so close to finishing) and then rebuilding it again in C#.

 

I am glad there is such useful insight on this forum! :D

ASRock B550M PG RIPTIDE       Corsair Vengeance 16 GB DDR4             TEAMGROUP MP33 1 TB NVME SSD

AMD Ryzen 5 5600X                   Antec DF700 Case                                 MSI Radeon RX 580 4 GB ARMOR OC

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×