اريد عمل اداة نص مخصصة ولكن كلما قمت بتوريث الاداة الجديدة من التكست بوكس يظهر لى خطا
دون ان اقوم بكتابة اى كود كل ما قمت بة انى اورثت الاداة الجديدة من التكست
هل من احد يوضح لى هذة المشكلة او يقوم بحلها
اريد عمل اداة نص مخصصة ولكن كلما قمت بتوريث الاداة الجديدة من التكست بوكس يظهر لى خطا
دون ان اقوم بكتابة اى كود كل ما قمت بة انى اورثت الاداة الجديدة من التكست
هل من احد يوضح لى هذة المشكلة او يقوم بحلها
ياجماعة ارجو المساعدة
بيظهر لى هذا الخطأ
WindowsControlLibrary4.UserControl1' does not contain a definition for 'AutoScaleMode'
كيف اقوم بعلاجة
تقريبا بيكون الكود كالتالي
public partial class UserControl1 : TextBox
{
public UserControl1()
{
InitializeComponent();
}
}اضغط Right-Click علي دالة InitializeComponent الموجودة في ال constructor ثم go to definition
و اعمل comment او احذف السطر الخاص بـ AutoScaleMode بالشكل التالي
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
//this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}و لذلك لان ال TextBox Control لا يحتوي علي هذه الخاصية بينما ال UserControl Class يحتوي عليها
تم تعديل هذه المشاركة بواسطة AhmedElbaz في 22 أكتوبر 2008 في 10:28
استاذ احمد الف شكر على ردك
ولكنى قمت بعمل ذلك بالفعل ولكن دون جدوى
اخ اوتاكا ما قاله الاخ احمد صحيح وقد جربته ولم تظهر مشكلة وهذا ما سيكون عليه شكل الكود
namespace WindowsControlLibrary1
{
partial class UserControl1
{
/// <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 Component 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()
{
components = new System.ComponentModel.Container();
//this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace WindowsControlLibrary1
{
public partial class UserControl1 : TextBox
{
public UserControl1()
{
InitializeComponent();
}
}
}الف شكر على اهتمامك اخى
Prof.Mendl
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…