03-10-18, 10:46 PM
ارفع اليك مشروع مبسط بدون ادوات dev
يوجد بية الكود المستخدم لترا وتشاهد بنفسك
https://up.top4top.net/downloadf-1006j7c4i1-7z.html
يوجد بية الكود المستخدم لترا وتشاهد بنفسك
https://up.top4top.net/downloadf-1006j7c4i1-7z.html
(03-10-18, 10:25 PM)abdalamask كتب : [ -> ]انا فعلت مع الليبل هل يوجد غير ادات اليبل لتعطينى اكثر من سطر
فى هذا الكود كما تقول ولكن اذا كانت الاية اكسر من سطر ماذا افعلكود :
if (Pages == Page)
{
int X = int.Parse(library.q.surahs[Surah].ayat[i].X);
int Y = int.Parse(library.q.surahs[Surah].ayat[i].Y);
Double h = rand(X, Y);
int width = library.q.surahs[Surah].ayat[i].text.Length+100;
int height = 25;// int.Parse(library.q.surahs[Surah].ayat[i].height);
LBL_S1_A1 = new Label();
LBL_S1_A1.BackColor = Color.Transparent;
LBL_S1_A1.Location = new Point(X, Y);
LBL_S1_A1.Name = string.Format("Page{0}_S{1}_A{2}", Page, Surah, i);
LBL_S1_A1.Size = new Size(width,Convert.ToInt32(h));
LBL_S1_A1.MouseClick += new MouseEventHandler(this.LBL_S1_A1_MouseClick);
LBL_S1_A1.MouseLeave += new EventHandler(this.LBL_S1_A6_2_MouseLeave);
LBL_S1_A1.MouseHover += new EventHandler(this.LBL_S1_A6_2_MouseHover);
cot.Controls.Add(LBL_S1_A1);
}
(03-10-18, 11:43 PM)abdalamask كتب : [ -> ]انا فى اول الامر فعلت ما قلت ولكن انت عندك 604 صفحة كيف سوف يتحمل المشروع مثل هذة الادة
لذالك قد فعلتها برمجيا واخذت X + Y width height
ولكن كل اية تجد انا ممكت ان تكون اكثر من سطر وتنتهى بنصف سطر هذة هى المعضلة
انا ابحث عن طريقة بدل اضافة الليبل واضافة اداة تضلل الاية على حسب حجمها ان كانت صغيرة او كبير كما هى موجودة فلى برنامج ايات
http://quran.ksu.edu.sa/index.php#aya=2_...rans=ar_mu
ارجوا ان نصل الى هذة المعلومة المميزة
(02-10-18, 06:37 AM)abdalamask كتب : [ -> ]شكرا اخى على الاهتمام ولكن ليس هذا ما اريدة
الفكرة هى عند تمرير الموس على الاية تظلل الاية كلها حتى ان كانت اكثر من سطر
انا فعلت ان اظلل سطر واحد
كيف اظلل الاية كلهههها حتى وان كانت سطر ونصف
شكرا
var p = new Page_1(Page);
p.eMouseLeave += this.LBL_S1_A6_2_MouseLeave;
p.eMouseClick += this.LBL_S1_A1_MouseClick;
p.eMouseHover += this.LBL_S1_A6_2_MouseHover;using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace QuranLibrary.ClassPages
{
public delegate void dMouseLeave(object sender, EventArgs e);
public delegate void dMouseHover(object sender, EventArgs e);
public delegate void dMouseClick(object sender, MouseEventArgs e);
public class Page_1 : Panel
{
public Color ColorMouseHover = Color.FromArgb(70, 185, 215, 252);
public Color ColorMouseLeave = Color.FromArgb(0, 255, 255, 255);
public event dMouseLeave eMouseLeave = null;
public event dMouseHover eMouseHover = null;
public event dMouseClick eMouseClick = null;
private Label Page1_S0_A0;
private Label Page1_S0_A1;
private Label Page1_S0_A5_2;
private Label Page1_S0_A5_1;
private Label Page1_S0_A4;
private Label Page1_S0_A3;
private Label Page1_S0_A2;
private Label Page1_S0_A6_3;
private Label Page1_S0_A6_2;
private Label Page1_S0_A6_1;
public Page_1 (int ImageNum1)
{
this.Page1_S0_A5_2 = new Label();
this.Page1_S0_A5_1 = new Label();
this.Page1_S0_A4 = new Label();
this.Page1_S0_A3 = new Label();
this.Page1_S0_A2 = new Label();
this.Page1_S0_A1 = new Label();
this.Page1_S0_A0 = new Label();
this.Page1_S0_A6_1 = new Label();
this.Page1_S0_A6_2 = new Label();
this.Page1_S0_A6_3 = new Label();
// panel1
//
this.BackgroundImage = Image.FromFile(Application.StartupPath + string.Format("\\images\\{0}.PNG", ImageNum1));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.Controls.Add(this.Page1_S0_A6_3);
this.Controls.Add(this.Page1_S0_A6_2);
this.Controls.Add(this.Page1_S0_A6_1);
this.Controls.Add(this.Page1_S0_A5_2);
this.Controls.Add(this.Page1_S0_A5_1);
this.Controls.Add(this.Page1_S0_A4);
this.Controls.Add(this.Page1_S0_A3);
this.Controls.Add(this.Page1_S0_A2);
this.Controls.Add(this.Page1_S0_A1);
this.Controls.Add(this.Page1_S0_A0);
this.AutoScroll = true;
this.Dock = System.Windows.Forms.DockStyle.Fill;
this.Location = new System.Drawing.Point(0, 0);
this.Size = new System.Drawing.Size(462, 673);
this.Name = "Page_1";
this.TabIndex = 0;
//
// Page1_S1_A7_3
//
this.Page1_S0_A6_3.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A6_3.Location = new System.Drawing.Point(186, 446);
this.Page1_S0_A6_3.Name = "Page1_S0_A6_3";
this.Page1_S0_A6_3.Size = new System.Drawing.Size(93, 21);
this.Page1_S0_A6_3.TabIndex = 9;
this.Page1_S0_A6_3.Text = " ";
this.Page1_S0_A6_3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A6_3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A6_3.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A6_3.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A7_2
//
this.Page1_S0_A6_2.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A6_2.Location = new System.Drawing.Point(155, 421);
this.Page1_S0_A6_2.Name = "Page1_S0_A6_2";
this.Page1_S0_A6_2.Size = new System.Drawing.Size(149, 21);
this.Page1_S0_A6_2.TabIndex = 8;
this.Page1_S0_A6_2.Text = " ";
this.Page1_S0_A6_2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A6_2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A6_2.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A6_2.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A7_1
//
this.Page1_S0_A6_1.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A6_1.Location = new System.Drawing.Point(125, 397);
this.Page1_S0_A6_1.Name = "Page1_S0_A6_1";
this.Page1_S0_A6_1.Size = new System.Drawing.Size(93, 21);
this.Page1_S0_A6_1.TabIndex = 7;
this.Page1_S0_A6_1.Text = " ";
this.Page1_S0_A6_1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A6_1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A6_1.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A6_1.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A6_2
//
this.Page1_S0_A5_2.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A5_2.Location = new System.Drawing.Point(233, 397);
this.Page1_S0_A5_2.Name = "Page1_S0_A5_2";
this.Page1_S0_A5_2.Size = new System.Drawing.Size(93, 21);
this.Page1_S0_A5_2.TabIndex = 6;
this.Page1_S0_A5_2.Text = " ";
this.Page1_S0_A5_2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A5_2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A5_2.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A5_2.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A6_1
//
this.Page1_S0_A5_1.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A5_1.Location = new System.Drawing.Point(115, 368);
this.Page1_S0_A5_1.Name = "Page1_S0_A5_1";
this.Page1_S0_A5_1.Size = new System.Drawing.Size(48, 21);
this.Page1_S0_A5_1.TabIndex = 5;
this.Page1_S0_A5_1.Text = " ";
this.Page1_S0_A5_1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A5_1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A5_1.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A5_1.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A5
//
this.Page1_S0_A4.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A4.Location = new System.Drawing.Point(164, 368);
this.Page1_S0_A4.Name = "Page1_S0_A4";
this.Page1_S0_A4.Size = new System.Drawing.Size(174, 21);
this.Page1_S0_A4.TabIndex = 4;
this.Page1_S0_A4.Text = " ";
this.Page1_S0_A4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A4.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A4.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A4
//
this.Page1_S0_A3.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A3.Location = new System.Drawing.Point(118, 340);
this.Page1_S0_A3.Name = "Page1_S0_A3";
this.Page1_S0_A3.Size = new System.Drawing.Size(111, 21);
this.Page1_S0_A3.TabIndex = 3;
this.Page1_S0_A3.Text = " ";
this.Page1_S0_A3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A3.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A3.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A3
//
this.Page1_S0_A2.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A2.Location = new System.Drawing.Point(236, 340);
this.Page1_S0_A2.Name = "Page1_S0_A2";
this.Page1_S0_A2.Size = new System.Drawing.Size(93, 21);
this.Page1_S0_A2.TabIndex = 2;
this.Page1_S0_A2.Text = " ";
this.Page1_S0_A2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A2.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A2.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A2
//
this.Page1_S0_A1.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A1.Location = new System.Drawing.Point(144, 317);
this.Page1_S0_A1.Name = "Page1_S0_A1";
this.Page1_S0_A1.Size = new System.Drawing.Size(166, 21);
this.Page1_S0_A1.TabIndex = 1;
this.Page1_S0_A1.Text = " ";
this.Page1_S0_A1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A1.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A1.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
// Page1_S1_A1
//
this.Page1_S0_A0.BackColor = System.Drawing.Color.Transparent;
this.Page1_S0_A0.Location = new System.Drawing.Point(161, 288);
this.Page1_S0_A0.Name = "Page1_S0_A0";
this.Page1_S0_A0.Size = new System.Drawing.Size(141, 21);
this.Page1_S0_A0.TabIndex = 0;
this.Page1_S0_A0.Text = " ";
this.Page1_S0_A0.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.Page1_S0_A0.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Page1_S1_A7_3_Click);
this.Page1_S0_A0.MouseLeave += new System.EventHandler(this.label1_MouseLeave);
this.Page1_S0_A0.MouseHover += new System.EventHandler(this.label1_MouseHover);
//
}
private void label1_MouseHover(object sender, EventArgs e)
{
if (eMouseHover != null) eMouseHover(sender, e);
Label lb = (Label)sender;
//if (lb.Name == "Page1_S1_A1")
// Page1_S0_A1.BackColor = ColorMouseHover;
//if (lb.Name == "Page1_S1_A2")
// Page1_S0_A2.BackColor = ColorMouseHover;
//if (lb.Name == "Page1_S1_A3")
// Page1_S0_A3.BackColor = ColorMouseHover;
//if (lb.Name == "Page1_S1_A4")
// Page1_S0_A4.BackColor = ColorMouseHover;
//if (lb.Name == "Page1_S1_A5")
// Page1_S0_A5.BackColor = ColorMouseHover;
if (lb.Name == "Page1_S0_A5_1")
{
Page1_S0_A5_1.BackColor = ColorMouseHover;
Page1_S0_A5_2.BackColor = ColorMouseHover;
}
if (lb.Name == "Page1_S0_A6_1")
{
Page1_S0_A6_1.BackColor = ColorMouseHover;
Page1_S0_A6_2.BackColor = ColorMouseHover;
Page1_S0_A6_3.BackColor = ColorMouseHover;
}
}
private void label1_MouseLeave(object sender, EventArgs e)
{
Label lb = (Label)sender;
if (eMouseLeave != null) eMouseLeave(sender, e);
//if (lb.Name == "Page1_S1_A1")
// Page1_S1_A1.BackColor = ColorMouseLeave;
//if (lb.Name == "Page1_S1_A2")
// Page1_S0_A2.BackColor = ColorMouseLeave;
//if (lb.Name == "Page1_S1_A3")
// Page1_S0_A3.BackColor = ColorMouseLeave;
//if (lb.Name == "Page1_S1_A4")
// Page1_S0_A4.BackColor = ColorMouseLeave;
//if (lb.Name == "Page1_S1_A5")
// Page1_S0_A5.BackColor = ColorMouseLeave;
if (lb.Name == "Page1_S0_A5_1")
{
Page1_S0_A5_1.BackColor = ColorMouseLeave;
Page1_S0_A5_2.BackColor = ColorMouseLeave;
} if (lb.Name == "Page1_S0_A6_1")
{
Page1_S0_A6_1.BackColor = ColorMouseLeave;
Page1_S0_A6_2.BackColor = ColorMouseLeave;
Page1_S0_A6_3.BackColor = ColorMouseLeave;
}
}
private void Page1_S1_A7_3_Click(object sender, MouseEventArgs e)
{
if (eMouseClick != null) eMouseClick(sender, e);
}
}
} var sName = string.Format("Page_{0}", Page);
var p = new sName (Page);
p.eMouseLeave += this.LBL_S1_A6_2_MouseLeave;
p.eMouseClick += this.LBL_S1_A1_MouseClick;
p.eMouseHover += this.LBL_S1_A6_2_MouseHover; Assembly asm = Assembly.LoadFrom(Application.StartupPath + "\\QuranLibrary.dll");
var allClasses = asm.GetTypes().Where(a => a.IsClass && a.Namespace != null && a.Namespace.Contains("QuranLibrary.ClassPages")).ToList();
allClasses.ForEach(t => Console.WriteLine(t.Name));
object newObject = Activator.CreateInstance(allClasses[0]);
var p = new Page_1(Page);
p.eMouseLeave += this.LBL_S1_A6_2_MouseLeave;
p.eMouseClick += this.LBL_S1_A1_MouseClick;
p.eMouseHover += this.LBL_S1_A6_2_MouseHover;