C# と VB.NET の質問掲示板

わんくま同盟

ASP.NET、C++/CLI、Java 何でもどうぞ

C# と VB.NET の入門サイト

■102661 / 4階層)  同じソリューションでASPDLLとWinFormDLLの共存
□投稿者/ ded (10回)-(2023/12/01(Fri) 16:13:12)
No102658 (WebSurfer さん) に返信
>>Freamework 4.6.2(C#)で作成したWinFormを継承して、Framework 4.7.2(VB)でフォームデザイナーの利用です。
> 
> コピペすれば問題を再現できる必要最低限のコードを提示できませんか?

現在、Currentチャネルの17.7.7を再インストール中です。

※迷惑投稿扱いされるのでソリューションとプロジェクトファイルは重要なところだけにします。

***************************************************************継承フォームテスト.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{1931C0E6-667F-4087-A3A9-E9ABBF51D30D}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsApp1", "WindowsApp1\WindowsApp1.vbproj", "{C3097A00-FE85-465F-BB1F-2C86F506C547}"
EndProject

***************************************************************ClassLibrary1.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{1931C0E6-667F-4087-A3A9-E9ABBF51D30D}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ClassLibrary1</RootNamespace>
    <AssemblyName>ClassLibrary1</AssemblyName>
    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
  </PropertyGroup>

***************************************************************Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ClassLibrary1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    }
}

***************************************************************Form1.Designer.cs
namespace ClassLibrary1
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(111, 125);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(219, 92);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            // 
            // statusStrip1
            // 
            this.statusStrip1.Location = new System.Drawing.Point(0, 428);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(800, 22);
            this.statusStrip1.TabIndex = 1;
            this.statusStrip1.Text = "statusStrip1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.statusStrip1);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.StatusStrip statusStrip1;
    }
}

***************************************************************WindowsApp1.vbproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{C3097A00-FE85-465F-BB1F-2C86F506C547}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <StartupObject>WindowsApp1.My.MyApplication</StartupObject>
    <RootNamespace>WindowsApp1</RootNamespace>
    <AssemblyName>WindowsApp1</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>WindowsForms</MyType>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>true</Deterministic>
  </PropertyGroup>

***************************************************************Form2.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form2
    Inherits ClassLibrary1.Form1

    'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows フォーム デザイナーで必要です。
    Private components As System.ComponentModel.IContainer

    'メモ: 以下のプロシージャは Windows フォーム デザイナーで必要です。
    'Windows フォーム デザイナーを使用して変更できます。  
    'コード エディターを使って変更しないでください。
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        components = New System.ComponentModel.Container
    End Sub

End Class

***************************************************************Form2.vb
Public Class Form2

End Class


編集キー/

前の記事(元になった記事) 次の記事(この記事の返信)
←Re[3]: 同じソリューションでASPDLLとWinFormDLLの共存 /WebSurfer 返信無し
 
上記関連ツリー

同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/11/30(Thu) 17:20) #102649
Re[1]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/11/30(Thu) 17:53) #102650
  └ Re[2]: 同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/12/01(Fri) 09:06) #102653
    └ Re[3]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/12/01(Fri) 09:38) #102654
      ├ Re[4]: 同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/12/01(Fri) 11:14) #102655
      │└ Re[5]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/12/01(Fri) 11:55) #102656
      │  └ Re[6]: 同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/12/01(Fri) 14:14) #102657
      │    ├ Re[7]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/12/01(Fri) 14:53) #102658
      │    ├ Re[7]: 同じソリューションでASPDLLとWinFormDLLの共存 / 魔界の仮面弁士 (23/12/01(Fri) 15:30) #102659
      │    │└ Re[8]: 同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/12/01(Fri) 16:31) #102662
      │    │  └ Re[9]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/12/01(Fri) 16:59) #102663
      │    └ Re[7]: 同じソリューションでASPDLLとWinFormDLLの共存 / WebSurfer (23/12/01(Fri) 15:47) #102660
      └ 同じソリューションでASPDLLとWinFormDLLの共存 / ded (23/12/01(Fri) 16:13) #102661 ←Now

上記ツリーを一括表示 / 上記ツリーをトピック表示
 
上記の記事へ返信