dll内的表格未显示 [英] Form inside a dll not showing

查看:52
本文介绍了dll内的表格未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试显示DLL中的一种形式....这是DLL TestApp中的代码.下面是TestApp内部的DLLNew类的代码.我无法更改代码,因为它是DLL.请帮帮我.


I am trying to show a form which is inside a DLL .... This is the code inside a DLL TestApp . Below is the code of class DLLNew inside TestApp . I am unable to change the code as it is a DLL . please help me out .


<pre lang="c#">using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace TestApp
{
	public class DLLNew
	{
		private frmPIN PinForm;
		public DLLNew()
		{
			this.PinForm = new frmPIN();
		}




表单代码如下所示




The form code begins as follows

using Microsoft.VisualBasic;
using Microsoft.VisualBasic.Compatibility.VB6;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
namespace TestApp
{
	[DesignerGenerated]
	internal class frmPIN : Form
	{
		private static List<WeakReference> __ENCList = new List<WeakReference>();
		private IContainer components;
		public ToolTip ToolTip1;




预先感谢.




Thanks in advance .

推荐答案

创建表单实例不会显示它-您需要先调用Show或ShowDialog方法,然后才能显示它.您的代码创建一个实例,但它不会尝试显示它.

通常,这样做是为了可以在显示表单之前设置选项,就像显示OpenFileDialog一样:


Creating a form instance does not display it - you need to call either the Show or the ShowDialog method before it will be displayed. Your code creates an instance, but it does not try to display it.

Normally, this is so that options can be set before the form is displayed, much as you do with you display a OpenFileDialog:


OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = StaticMethods.MakeFilter("Music files", new string[] { "mp3", "wmv", "wav" });
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
    {
    ...
    }


这篇关于dll内的表格未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆