.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Stop Thread

Posted By: kamlesh     Posted Date: March 04, 2011    Points:2   Category :Windows Application
hi

i have one application in which in one button click event i start Thread
th = new Thread(new ThreadStart(disp12));
th.IsBackground = true;
th.Start();

and in disp12 i am opening one new form
void disp12()
{
frmload = new frmLoading();
frmload.ShowDialog();
}
but i want to close that form in button Click event when all operation will completed. how to close that new form in old form please help

Responses
Author: Senthilnathan             
Posted Date: March 04, 2011     Points: 20   

void disp12()
{
frmload = new frmLoading();
frmload.Show();
frmload.close();
}


Author: Karthikeyan Anbarasan       [Moderator]      
Posted Date: March 04, 2011     Points: 20   

Hi,

You need to create an instance of the form and then close the form.

void disp12()
{
frmLoading frmload = new frmLoading();
frmload.Close();
}


Thanks
Karthik
http://www.f5debug.net
Mark as Answer if the answer solves your issue!!!
Author: Maverick             
Posted Date: March 07, 2011     Points: 20   

Hello,

Create an object if that form

i.e..

frmMyForm = new frmMyForm();
frmMyForm.close();

Hope it helps.

Thanks,
Maverick

Thanks,
Maverick
Author: kamlesh             
Posted Date: March 07, 2011     Points: 20   

ALTER PROCEDURE [dbo].[GetAllNodes]
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select * from dbo.MailRoutefolder
Select * from dbo.MailSubFolder
END

ALTER PROCEDURE [dbo].[GetAllRouteFolder]
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select * from dbo.MailRoutefolder

END

ALTER PROCEDURE [dbo].[GetAllSubFolders]
@RouteFolderId int
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select * from dbo.MailSubFolder
END

ALTER PROCEDURE [dbo].[GetMailDetailByRouteFolderID]
@RouteFolderId int,
@Filter varchar(200)
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
if @Filter=''
begin
Select * from dbo.MailMaster where RouteFolderId=@RouteFolderId
end
else
begin
Select * from dbo.MailMaster where RouteFolderId=@RouteFolderId and (MailFrom like '%'+ @Filter + '%' or MailTo like '%'+ @Filter + '%' or MailCc like '%'+ @Filter + '%' or MailSubject like '%' + @Filter + '%' or MailBody like '%'+ @Filter + '%' or MailBodyPlain like '%'+ @Filter + '%')
end
END

ALTER PROCEDURE [dbo].[GetMailDetailBysubFolderID]
@SubFolderId int,
@Filter varchar(200)
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
if @Filter=''
begin
Select * from dbo.MailMaster where SubFolderId=@SubFolderId
end
else
begin
Select * from dbo.MailMaster where SubFolderId=@SubFolderId and (MailFrom like '%'+ @Filter + '%' or MailTo like '%'+ @Filter + '%' or MailCc like '%'+ @Filter + '%' or MailSubject like '%' + @Filter + '%' or MailBody like '%'+ @Filter + '%' or MailBodyPlain like '%'+ @Filter + '%' )
end
END


ALTER PROCEDURE [dbo].[GetTopFolderbySubFolderId]
@SubFolderId int
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select MailSubFolder.*,MailRoutefolder.Name as RouteFolderName from
dbo.MailSubFolder left join dbo.MailRoutefolder on MailSubFolder.RouteFolderID=MailRoutefolder.ID where MailSubFolder.ID = @SubFolderId


END



ALTER PROCEDURE [dbo].[IsRouteFolderExists]
@RouteFolderName varchar(200)
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select * from dbo.MailRoutefolder where Name=@RouteFolderName

END


ALTER PROCEDURE [dbo].[IsSubFolderExists]
@SubFolderName varchar(200),
@RouteFolderID int
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
Select * from dbo.MailSubFolder where [Name]=@SubFolderName and RouteFolderID=@RouteFolderID

END


ALTER PROCEDURE [dbo].[SaveMail]
@RouteFolderID int,
@SubFolderId int,
@MailFrom varchar(50),
@MailTo varchar(MAX),
@MailCc varchar(MAX),
@MailBcc varchar(MAX),
@MailSubject varchar(MAX),
@MailBody varchar(MAX),
@MailDate datetime,
@MailSize int,
@HasAttechment bit,
@MailBodyPlain nvarchar(MAX)

AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO [dbo].[MailMaster]
([RouteFolderId]
,[SubFolderId]
,[MailFrom]
,[MailTo]
,[MailCc]
,[MailBcc]
,[MailSubject]
,[MailBody]
,[MailDate]
,[MailSize]
,[HasAttechment]
,[MailBodyPlain])
OUTPUT INSERTED.ID
VALUES
(@RouteFolderID,@SubFolderId,@MailFrom,@MailTo,@MailCc,@MailBcc,@MailSubject,@MailBody,@MailDate,@MailSize,@HasAttechment,@MailBodyPlain)

END

ALTER PROCEDURE [dbo].[SaveMailRouteFolder]
@Name varchar(250)
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT into [dbo].[MailRoutefolder]
([Name])OUTPUT INSERTED.ID
VALUES
(@Name)

END


ALTER PROCEDURE [dbo].[SaveMailSubFolder]
@Name varchar(50),
@RouteFolderID int,
@Lavel int,
@ParentId int,
@HasChildNode bit
AS
BEGIN
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO [dbo].[MailSubFolder]
([Name]
,[RouteFolderID]
,[Lavel]
,[ParentId]
,[HasChildNode])
OUTPUT INSERTED.ID
VALUES
(@Name,@RouteFolderID,@Lavel,@ParentId,@HasChildNode)

END

Thanks And Regards.
Kamlesh Nikam


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend