01-10-18, 08:57 PM
السلام عليكم
ارجوا مساعدتى فى معرفة كيفية تظليل الاية التى هى اكثر من سطر كما هى موجودة فى برنامج ايات
انا قد استخدمت كود ولكن هو يضلل سطر واحد ولكن الاية ان كانت اكثر من سطر
كيف ارجو المساعدة فى ذالك
هذا الكود نجح فى تظليل الاية ولكن سطر واحد قد استخدمن بداية مكان الاية ونهايتة x وy مع طول السطر
صورة البرنامج ايات من الموقع للتوضيح
[attachment=23906]
ارجوا الاهتمام
ارجوا مساعدتى فى معرفة كيفية تظليل الاية التى هى اكثر من سطر كما هى موجودة فى برنامج ايات
انا قد استخدمت كود ولكن هو يضلل سطر واحد ولكن الاية ان كانت اكثر من سطر
كيف ارجو المساعدة فى ذالك
كود :
public Color ColorMouseHover = Color.FromArgb(70, 185, 215, 252);
public Color ColorMouseLeave = Color.FromArgb(0, 255, 255, 255);
#region ColorMouse
public void setColorMouseHover(int sura, int ayah)
{
try
{
if (P1.Controls.Count > 1)
{
var g = P1.Controls.Find(string.Format("Page{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (g.Length > 0)
{
Label lb = (Label)g[0];
lb.BackColor = ColorMouseHover;
}
var R = P1.Controls.Find(string.Format("Rich{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (R.Length > 0)
{
Label Rich = (Label)R[0];
Rich.BackColor = ColorMouseHover;
Rich.ForeColor = Color.Blue;
}
}
if (P2.Controls.Count > 1)
{
var g = P2.Controls.Find(string.Format("Page{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (g.Length > 0)
{
Label lb = (Label)g[0];
lb.BackColor = ColorMouseHover;
}
var R = P2.Controls.Find(string.Format("Rich{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (R.Length > 0)
{
Label Rich = (Label)R[0];
Rich.BackColor = ColorMouseHover;
Rich.ForeColor = Color.Blue;
}
}
}
catch
{
return;
}
}
public void setColorMouseLeave(int sura, int ayah)
{
try
{
if (P1.Controls.Count > 1)
{
var g = P1.Controls.Find(string.Format("Page{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (g.Length > 0)
{
Label lb = (Label)g[0];
lb.BackColor = ColorMouseLeave;
}
var R = P1.Controls.Find(string.Format("Rich{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (R.Length > 0)
{
Label Rich = (Label)R[0];
Rich.BackColor = ColorMouseLeave;
Rich.ForeColor = Color.Black;
}
}
if (P2.Controls.Count > 1)
{
var g = P2.Controls.Find(string.Format("Page{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (g.Length > 0)
{
Label lb = (Label)g[0];
lb.BackColor = ColorMouseLeave;
}
var R = P2.Controls.Find(string.Format("Rich{0}_S{1}_A{2}", ImageNum1, sura, ayah), true);
if (R.Length > 0)
{
Label Rich = (Label)R[0];
Rich.BackColor = ColorMouseLeave;
Rich.ForeColor = Color.Black;
}
}
}
catch
{
return;
}
}
#endregion
#region void
public Double rand(int x, int y)
{
Random clsRnd = new Random();
return Math.Floor(clsRnd.NextDouble() * (y - x + 1) + x);
}
public void SetControlsToPanel(Control cot, int startSurah, int startAyah, int Page)
{
try
{
cot.Controls.Clear();
int PagesSub = Page - 1;
//=====================================================================
int f = library.QuranMetaData.PagesContainer._pages[PagesSub].aya - 1;
int Surah = library.QuranMetaData.PagesContainer._pages[PagesSub].sura - 1;
int K = library.QuranMetaData.SurahsContainer._suras[Surah].ayas - 1;
int r = Page;
int v = library.QuranMetaData.PagesContainer._pages[r].aya;
if (library.QuranMetaData.PagesContainer._pages[PagesSub].sura == library.QuranMetaData.PagesContainer._pages[r].sura)
{
startAyah = v;
}
else
{
startAyah = v + K;
}
//==================================================================
for (int i = f; i < startAyah; i++)
{
if (library.q.surahs[Surah].ayat[i].Page == null) return;
int Pages = int.Parse(library.q.surahs[Surah].ayat[i].Page);
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);
int width = int.Parse(library.q.surahs[Surah].ayat[i].width);
int height = 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, height);
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);
}
}
}
catch
{
return;
}
}
void Rich_teb_1_MouseHover(object sender, EventArgs e)
{
Label txt = (Label)sender;
txt.BackColor = ColorMouseHover;
}
void Rich_teb_1_MouseLeave(object sender, EventArgs e)
{
Label txt = (Label)sender;
txt.BackColor = ColorMouseLeave;
}هذا الكود نجح فى تظليل الاية ولكن سطر واحد قد استخدمن بداية مكان الاية ونهايتة x وy مع طول السطر
صورة البرنامج ايات من الموقع للتوضيح
[attachment=23906]
ارجوا الاهتمام