kingosticks
Programmer
Hello, have been looking for a decent delphi forum for my problem, hopefuly my search is over. I have the type
TMsgFrame : class(Tframe)
with a bunch of procedures, components etc contained within it. i also have the following record on my main form:
TPost = record
PMWin : TTabSheet;
PMFrame : TMsgFrame;
end;
and Users which is an array of TPost.
when a certain event happens (message recieved from a socket) i want to create a new tabsheet and a new frame on this tabsheet to display some info about the recieved message so i have done this:
Users[index].PMWin:=TTabSheet.Create(self);
Users[index].PMWin.Caption:=Users[index].Nick;
Users[index].PMWin.PageControl:=PgeCtrlSearch;
Users[index].PMFrame:=TMsgFrame.Create(self);
Users[index].PMFrame.Parent:=Users[index].PMWin;
it can create the first tab and frame ok but when another message is received i get the error "A component named MsgFrame already exists". Im a little confused to why i can create the tabsheets but not the MsgFrames. i dont even need a name for it seeing as it will only be referenced using the record in the Users array anyway. any help would be much appreciated, this has left me rather stuck!
TMsgFrame : class(Tframe)
with a bunch of procedures, components etc contained within it. i also have the following record on my main form:
TPost = record
PMWin : TTabSheet;
PMFrame : TMsgFrame;
end;
and Users which is an array of TPost.
when a certain event happens (message recieved from a socket) i want to create a new tabsheet and a new frame on this tabsheet to display some info about the recieved message so i have done this:
Users[index].PMWin:=TTabSheet.Create(self);
Users[index].PMWin.Caption:=Users[index].Nick;
Users[index].PMWin.PageControl:=PgeCtrlSearch;
Users[index].PMFrame:=TMsgFrame.Create(self);
Users[index].PMFrame.Parent:=Users[index].PMWin;
it can create the first tab and frame ok but when another message is received i get the error "A component named MsgFrame already exists". Im a little confused to why i can create the tabsheets but not the MsgFrames. i dont even need a name for it seeing as it will only be referenced using the record in the Users array anyway. any help would be much appreciated, this has left me rather stuck!