Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2004, 04:42 AM
sis sis is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sis
Default Problem using AppendText with Tab pages

Hi
I'm trying to gather text in txtboxes on tabpage1 and show it in txtbox on tabpage2. This is supposed to happen when clicked on a button on the form it self. However when using
txtBox.AppendText(txtbox1.Text);

the program crashes !!
I've already made sure that something is in txtBox on tabpage2 so that is not the problem...
If anyone knows what I'm doing wrong og why and how to make it work :D
I'd be grateful
wh.
sis

 
Old February 16th, 2004, 10:54 AM
Authorized User
 
Join Date: Nov 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to KABay
Default

You don't say that you have also made sure something is [u]selected</u> in your source textbox. Maybe you are trying to append a null string. Is it?

Code:
// Determine if text is selected in textBox1.
   if(textBox1.SelectionLength == 0)
      // No selection made, return.
      return;

   // Determine if the text being appended to textBox2 exceeds the MaxLength property.
   if((textBox1.SelectedText.Length + textBox2.TextLength) > textBox2.MaxLength)
      MessageBox.Show("The text to paste in is larger than the maximum number of characters allowed");
   else
      // Append the text from textBox1 into textBox2.
      textBox2.AppendText(textBox1.SelectedText);

{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformstextboxbaseclassappendtextt opic.asp}

Show us the code!
 
Old February 16th, 2004, 11:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u know I have the same problem & I still stuck on
I found out that its reason is that the control in next Tab_Page is unknown, u can see it my tracing. anyway when u visit next Tab-Page & back to previous Tab-Page it solved. I'll be glad if u tell me in any conclusion. Tnx.

Always:),
Hovik Melkomian.
 
Old February 16th, 2004, 05:59 PM
sis sis is offline
Registered User
 
Join Date: Jan 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sis
Default

Thank you but, :D
I don't think that is the problem as it works just fine if its all on the same tabPage. And I've tried checking if it selected and if it is too long...

 My guess is that is has something to do woth using the tab control
sis






Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross tab problem sanjivbshinde Crystal Reports 0 August 21st, 2007 11:36 PM
Referencing Fields within Tab Control Pages -Help TomW Access VBA 1 October 30th, 2006 01:31 PM
newline and tab characters problem anshul Beginning PHP 1 December 2nd, 2004 06:58 AM
Problem Setting Tab Control selectedIndex Ron Howerton VB.NET 2002/2003 Basics 0 July 13th, 2004 03:31 PM
Tab page problem melvik C# 0 September 23rd, 2003 09:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.