Click here to Skip to main content
15,903,523 members
Home / Discussions / C#
   

C#

 
GeneralRe: My ASP.NET 2.0 Web Pages do not run inside IIS Pin
tedhill1323-Jul-06 9:23
tedhill1323-Jul-06 9:23 
QuestionPictureBox in mdi form Pin
Saamir20-Jul-06 11:32
Saamir20-Jul-06 11:32 
AnswerRe: PictureBox in mdi form Pin
Ed.Poore20-Jul-06 12:50
Ed.Poore20-Jul-06 12:50 
QuestionRe: PictureBox in mdi form Pin
Saamir20-Jul-06 16:45
Saamir20-Jul-06 16:45 
AnswerRe: PictureBox in mdi form Pin
Ed.Poore20-Jul-06 21:07
Ed.Poore20-Jul-06 21:07 
Question.insert is inserting 2 entries instead of one... please help. Pin
jaman4dbz20-Jul-06 11:02
jaman4dbz20-Jul-06 11:02 
AnswerRe: .insert is inserting 2 entries instead of one... please help. Pin
Ed.Poore20-Jul-06 12:48
Ed.Poore20-Jul-06 12:48 
AnswerRe: .insert is inserting 2 entries instead of one... please help. Pin
Alexander Wiseman20-Jul-06 13:33
Alexander Wiseman20-Jul-06 13:33 
One thing I notice about your function is this line:
TabPage newtabpage = blanktabpage
Where is blanktabpage initialized and created? The question is important because I think your code is not actually creating a new TabPage every time the function is called. The reason for this is that class types are reference types, which means that unless you actually have the new keyword in there, you are not creating another instance of the class in memory. I'm not completely sure I have this down properly (I may have been wrong in my explanation), but have a look at this article by Jon Skeet[^] on the distinction between reference types and value types.

What this means (I think) for your code is that newtabpage refers to an already existing TabPage in memory. Changes that you are making with the variable newtabpage are affecting what blanktabpage points to. I'm not sure that this will necessarily produce the effect you are describing, but it is a problem.

Try this instead: at the beginning of your addatab function, use the new keyword instead, like this:
TabPage newtabpage = new TabPage()
Then set the properties of the tab page based on the properties of blanktabpage and see what happens when you call Add or Insert.

I'm fairly sure what I have said in this post is correct concerning reference types, but if I am wrong, I would welcome a correction from anyone who knows better.

Sincerely,
Alexander Wiseman
AnswerRe: .insert is inserting 2 entries instead of one... please help. Pin
jaman4dbz20-Jul-06 14:09
jaman4dbz20-Jul-06 14:09 
GeneralRe: .insert is inserting 2 entries instead of one... please help. Pin
Alexander Wiseman20-Jul-06 14:26
Alexander Wiseman20-Jul-06 14:26 
GeneralRe: .insert is inserting 2 entries instead of one... please help. Pin
jaman4dbz21-Jul-06 6:21
jaman4dbz21-Jul-06 6:21 
QuestionSecurity Permissions Pin
JuanAlbertoMD20-Jul-06 10:21
JuanAlbertoMD20-Jul-06 10:21 
QuestionAutomatic variable name incrementation [modified] Pin
The Big Bunny20-Jul-06 10:21
The Big Bunny20-Jul-06 10:21 
AnswerRe: Automatic variable name incrementation Pin
ankita patel20-Jul-06 11:00
ankita patel20-Jul-06 11:00 
AnswerRe: Automatic variable name incrementation Pin
led mike20-Jul-06 11:06
led mike20-Jul-06 11:06 
GeneralRe: Automatic variable name incrementation Pin
The Big Bunny21-Jul-06 8:51
The Big Bunny21-Jul-06 8:51 
Questionhelp file issue Pin
_tasleem20-Jul-06 9:42
_tasleem20-Jul-06 9:42 
AnswerRe: help file issue Pin
Ed.Poore20-Jul-06 12:41
Ed.Poore20-Jul-06 12:41 
GeneralRe: help file issue Pin
_tasleem21-Jul-06 1:06
_tasleem21-Jul-06 1:06 
GeneralRe: help file issue Pin
Ed.Poore21-Jul-06 12:09
Ed.Poore21-Jul-06 12:09 
GeneralRe: help file issue Pin
_tasleem21-Jul-06 20:30
_tasleem21-Jul-06 20:30 
QuestionDocumentation of DLL(.net) in design time Pin
mosquets20-Jul-06 9:16
mosquets20-Jul-06 9:16 
AnswerRe: Documentation of DLL(.net) in design time Pin
Ed.Poore20-Jul-06 12:37
Ed.Poore20-Jul-06 12:37 
QuestionRe: Documentation of DLL(.net) in design time Pin
mosquets21-Jul-06 4:11
mosquets21-Jul-06 4:11 
AnswerRe: Documentation of DLL(.net) in design time Pin
Ed.Poore21-Jul-06 12:10
Ed.Poore21-Jul-06 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.