开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 9725|回复: 6

DevExpress中CreateWaitDialog的实现

[复制链接]

0

精华

1316

贡献

885

赞扬

版主

帖子
176
软币
8139
在线时间
1139 小时
注册时间
2013-6-10
发表于 2013-7-19 09:15:39 | 显示全部楼层 |阅读模式
请参照下面VB的例子,使用C#的话,可以非常容易的改过来。其实就是一个多线程的问题。

Module ModuleWaitDialog
    Private Dlg As DevExpress.Utils.WaitDialogForm = Nothing
    Public Sub CreateWaitDialog(Optional ByVal Caption As String = "", Optional ByVal Title As String = "")
        If Title = "" Then
            Dlg = New DevExpress.Utils.WaitDialogForm(Caption)
        Else
            Dlg = New DevExpress.Utils.WaitDialogForm(Caption, Title)
        End If
    End Sub
    Public Sub CloseWaitDialog()
        Dlg.Close()
    End Sub
    Public Sub SetWaitDialogCaption(ByVal fCaption As String)
        If Dlg IsNot Nothing Then
            Dlg.Caption = fCaption
        End If
    End Sub
End Module


评分

参与人数 4赞扬 +4 收起 理由
ibm2000 + 1 Thanks
羽叶 + 1 感谢分享
sunjian1213 + 1 感谢分享
nickcole + 1 赞一个,看上去不错

查看全部评分

回复

使用道具 举报

0

精华

10

贡献

15

赞扬

帖子
11
软币
1042
在线时间
4 小时
注册时间
2013-6-9
发表于 2013-7-25 09:25:12 | 显示全部楼层
谢谢分享,先学习!
回复

使用道具 举报

0

精华

0

贡献

60

赞扬

帖子
138
软币
2531
在线时间
317 小时
注册时间
2013-6-8
发表于 2013-7-29 02:27:55 | 显示全部楼层
Hi Bro  C# Code Plesa
回复

使用道具 举报

0

精华

100

贡献

33

赞扬

帖子
132
软币
3320
在线时间
53 小时
注册时间
2013-8-31
发表于 2013-9-7 07:51:37 | 显示全部楼层
可惜是VB的
回复

使用道具 举报

0

精华

451

贡献

5379

赞扬

帖子
324
软币
20243
在线时间
1784 小时
注册时间
2013-6-8

胡吹海聊

发表于 2013-9-7 08:27:12 | 显示全部楼层

转换一下差不多就这样
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
static class ModuleWaitDialog
{
        private static DevExpress.Utils.WaitDialogForm Dlg = null;
        public static void CreateWaitDialog(string Caption = "", string Title = "")
        {
                if (string.IsNullOrEmpty(Title)) {
                        Dlg = new DevExpress.Utils.WaitDialogForm(Caption);
                } else {
                        Dlg = new DevExpress.Utils.WaitDialogForm(Caption, Title);
                }
        }
        public static void CloseWaitDialog()
        {
                Dlg.Close();
        }
        public static void SetWaitDialogCaption(string fCaption)
        {
                if (Dlg != null) {
                        Dlg.Caption = fCaption;
                }
        }
}
回复

使用道具 举报

0

精华

518

贡献

356

赞扬

正版授权组

Rank: 14Rank: 14Rank: 14Rank: 14

帖子
213
软币
7131
在线时间
1173 小时
注册时间
2013-6-9
发表于 2013-11-4 17:17:00 | 显示全部楼层
正好要用到 谢谢楼主
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-5-8 23:14

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表