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

How ToAccess dynamically added Rich Text Box

I m creating a multi tab application. i m adding tab & RichTextBox in tab control through programming. i want to access the text of rich text box.
plz help me....
Apr 14 '09 #1
3 2224
tlhintoq
3,525 Expert 2GB
myRichTextBox.Text

Very straight forward and direct
Apr 15 '09 #2
@tlhintoq
I had tried your suggestion before... but when you add control at run-time you cant directly refer to it using its name... The application wont compile...

I havent used tabs in my applications yet..
But you can find a richtextbox in your form by using the following method...

Expand|Select|Wrap|Line Numbers
  1. Dim form As ControlCollection = Me.Controls
  2. Dim richTxt as array
  3. richTxt = grpBox.Controls.Find("Richtxt", True)     
  4. ' Richtxt is the name property of the richtextbox you are searching for.
  5.  
  6. 'you can refer to its text property using...
  7. richTxt(0).text= "modify me .... .... ..."
Apr 21 '09 #3
tlhintoq
3,525 Expert 2GB
You shouldn't have to go find it since you made it. You just need to add a little more to the part where you make it so you don't loose track of it.

It would be much cleaner and easier if when you make the control you add it to known variable. Then you don't have to go looking for it later.

Sorry the example is in C# instead of VB, but you should be able to follow.
1. Make a member variable visible to all methods
2. Add to it, the dynamically created textbox
3. Later when you need it, you already know where it is

Expand|Select|Wrap|Line Numbers
  1. TextBox myNewTextbox;
  2.  
  3. private void SetupControls()
  4. {
  5.    myNewTextBox = new TextBox();
  6.    myNewTextBox.Text = "Feed me Simore";
  7.    myNewTextBox.Click += new MyNewTextBox_Click(ClickHandler);
  8. }
Apr 22 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML...
0
by: sameer mowade via .NET 247 | last post by:
Hello All, I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
2
by: Web Team | last post by:
Hi All, I'm in the process of writing a eich text editor web custom control. The actual text/HTML is displayed/editied in a DIV layer, which I have created like this: output.Write("<span...
4
by: Fool | last post by:
Hi, I want a rich textbox that dynamically highlights particular words immediately after they are typed. Just looking for some general tips... I tried putting some code in a sub that handles...
5
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add Another Email", "-" to remove, and a "Save" button....
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
3
by: Allen Chen [MSFT] | last post by:
Hi Richard, Quote from Richard================================================== However I also want to be able to remove the panes. I have tried to include this, but find that when I first...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.