Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Convert string into expression Pin
Nick Seng31-Jul-03 15:34
Nick Seng31-Jul-03 15:34 
Generalwindows service written in C++, COM objects, call from C# Pin
alma31-Jul-03 3:11
alma31-Jul-03 3:11 
GeneralRe: windows service written in C++, COM objects, call from C# Pin
alma31-Jul-03 23:20
alma31-Jul-03 23:20 
Generalrunning function in Form from UserControl Pin
Hovik Melkomian31-Jul-03 1:23
Hovik Melkomian31-Jul-03 1:23 
GeneralRe: running function in Form from UserControl Pin
Rampas Tomas31-Jul-03 2:09
Rampas Tomas31-Jul-03 2:09 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian3-Aug-03 2:40
Hovik Melkomian3-Aug-03 2:40 
GeneralRe: running function in Form from UserControl Pin
Rampas Tomas3-Aug-03 21:34
Rampas Tomas3-Aug-03 21:34 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian4-Aug-03 2:54
Hovik Melkomian4-Aug-03 2:54 
dear friend:
tnx for ur reply indeed, u can think that im silly but I couldn't do itCry | :((
now im sending my UserContol Code & if its possible tell mo how to do that!?
I'll really be thankfull!

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace Dabir
{
///
/// Summary description for UserControl1.
///

public class ArrowControl : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Panel panel1;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.Button buttonLast;
private System.Windows.Forms.Button buttonNext;
private System.Windows.Forms.Button buttonPrev;
private System.Windows.Forms.Button buttonFirst;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.Button buttonNew;
private System.Windows.Forms.Button buttonDelete;
private System.Windows.Forms.Button buttonEdit;
private System.Windows.Forms.Button buttonSearch;
private System.Windows.Forms.Button buttonFilter;
private System.Windows.Forms.Button buttonSort;
private System.Windows.Forms.Button buttonOk;
private System.Windows.Forms.Button buttonCancel;
//My Var
public BindingManagerBase UCBinder;
public DataSet UCDataSet;
public string UCAction;
private bool InEditMode;
//events
public event AddNewRecord NewRecord;
public delegate void MyControEventHandeler(object sender, MyCustomEventArgs mcea);

public ArrowControl()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();

// TODO: Add any initialization after the InitComponent call
InEditMode = false;

}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
}

#region Component Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ArrowControl));
this.panel1 = new System.Windows.Forms.Panel();
this.buttonOk = new System.Windows.Forms.Button();
this.buttonFilter = new System.Windows.Forms.Button();
this.buttonSearch = new System.Windows.Forms.Button();
this.buttonEdit = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonNew = new System.Windows.Forms.Button();
this.buttonFirst = new System.Windows.Forms.Button();
this.buttonPrev = new System.Windows.Forms.Button();
this.buttonNext = new System.Windows.Forms.Button();
this.buttonLast = new System.Windows.Forms.Button();
this.buttonDelete = new System.Windows.Forms.Button();
this.buttonSort = new System.Windows.Forms.Button();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.buttonOk);
this.panel1.Controls.Add(this.buttonFilter);
this.panel1.Controls.Add(this.buttonSearch);
this.panel1.Controls.Add(this.buttonEdit);
this.panel1.Controls.Add(this.buttonCancel);
this.panel1.Controls.Add(this.buttonNew);
this.panel1.Controls.Add(this.buttonFirst);
this.panel1.Controls.Add(this.buttonPrev);
this.panel1.Controls.Add(this.buttonNext);
this.panel1.Controls.Add(this.buttonLast);
this.panel1.Controls.Add(this.buttonDelete);
this.panel1.Controls.Add(this.buttonSort);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.panel1.Size = new System.Drawing.Size(248, 88);
this.panel1.TabIndex = 4;
//
// buttonOk
//
this.buttonOk.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonOk.BackgroundImage")));
this.buttonOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonOk.Location = new System.Drawing.Point(8, 8);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new System.Drawing.Size(32, 32);
this.buttonOk.TabIndex = 5;
this.toolTip.SetToolTip(this.buttonOk, "تاييد");
//
// buttonFilter
//
this.buttonFilter.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonFilter.BackgroundImage")));
this.buttonFilter.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFilter.Location = new System.Drawing.Point(208, 48);
this.buttonFilter.Name = "buttonFilter";
this.buttonFilter.Size = new System.Drawing.Size(32, 32);
this.buttonFilter.TabIndex = 6;
this.toolTip.SetToolTip(this.buttonFilter, "فيلتر");
this.buttonFilter.Click += new System.EventHandler(this.buttonFilter_Click);
//
// buttonSearch
//
this.buttonSearch.BackColor = System.Drawing.SystemColors.Control;
this.buttonSearch.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonSearch.BackgroundImage")));
this.buttonSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSearch.Location = new System.Drawing.Point(8, 48);
this.buttonSearch.Name = "buttonSearch";
this.buttonSearch.Size = new System.Drawing.Size(32, 32);
this.buttonSearch.TabIndex = 11;
this.toolTip.SetToolTip(this.buttonSearch, "جستجو");
//
// buttonEdit
//
this.buttonEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonEdit.BackgroundImage")));
this.buttonEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEdit.Location = new System.Drawing.Point(48, 48);
this.buttonEdit.Name = "buttonEdit";
this.buttonEdit.Size = new System.Drawing.Size(32, 32);
this.buttonEdit.TabIndex = 10;
this.toolTip.SetToolTip(this.buttonEdit, "ويرايش");
this.buttonEdit.Click += new System.EventHandler(this.buttonEdit_Click);
//
// buttonCancel
//
this.buttonCancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonCancel.BackgroundImage")));
this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonCancel.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.buttonCancel.Location = new System.Drawing.Point(208, 8);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.buttonCancel.Size = new System.Drawing.Size(32, 32);
this.buttonCancel.TabIndex = 0;
this.toolTip.SetToolTip(this.buttonCancel, "برگشت");
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// buttonNew
//
this.buttonNew.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonNew.BackgroundImage")));
this.buttonNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNew.Location = new System.Drawing.Point(88, 48);
this.buttonNew.Name = "buttonNew";
this.buttonNew.Size = new System.Drawing.Size(32, 32);
this.buttonNew.TabIndex = 9;
this.toolTip.SetToolTip(this.buttonNew, "جديد");
//
// buttonFirst
//
this.buttonFirst.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonFirst.BackgroundImage")));
this.buttonFirst.Cursor = System.Windows.Forms.Cursors.Default;
this.buttonFirst.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonFirst.Location = new System.Drawing.Point(48, 8);
this.buttonFirst.Name = "buttonFirst";
this.buttonFirst.Size = new System.Drawing.Size(32, 32);
this.buttonFirst.TabIndex = 4;
this.toolTip.SetToolTip(this.buttonFirst, "رکورد اول");
this.buttonFirst.Click += new System.EventHandler(this.buttonFirst_Click);
//
// buttonPrev
//
this.buttonPrev.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonPrev.BackgroundImage")));
this.buttonPrev.Cursor = System.Windows.Forms.Cursors.Default;
this.buttonPrev.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonPrev.Location = new System.Drawing.Point(88, 8);
this.buttonPrev.Name = "buttonPrev";
this.buttonPrev.Size = new System.Drawing.Size(32, 32);
this.buttonPrev.TabIndex = 3;
this.toolTip.SetToolTip(this.buttonPrev, "رکورد قبلي");
this.buttonPrev.Click += new System.EventHandler(this.buttonPrev_Click);
//
// buttonNext
//
this.buttonNext.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonNext.BackgroundImage")));
this.buttonNext.Cursor = System.Windows.Forms.Cursors.Default;
this.buttonNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonNext.Location = new System.Drawing.Point(128, 8);
this.buttonNext.Name = "buttonNext";
this.buttonNext.Size = new System.Drawing.Size(32, 32);
this.buttonNext.TabIndex = 2;
this.toolTip.SetToolTip(this.buttonNext, "رکورد بعدي");
this.buttonNext.Click += new System.EventHandler(this.buttonNext_Click);
//
// buttonLast
//
this.buttonLast.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonLast.BackgroundImage")));
this.buttonLast.Cursor = System.Windows.Forms.Cursors.Default;
this.buttonLast.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonLast.Location = new System.Drawing.Point(168, 8);
this.buttonLast.Name = "buttonLast";
this.buttonLast.Size = new System.Drawing.Size(32, 32);
this.buttonLast.TabIndex = 1;
this.toolTip.SetToolTip(this.buttonLast, "رکورد آخر");
this.buttonLast.Click += new System.EventHandler(this.buttonLast_Click);
//
// buttonDelete
//
this.buttonDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonDelete.BackgroundImage")));
this.buttonDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonDelete.Location = new System.Drawing.Point(128, 48);
this.buttonDelete.Name = "buttonDelete";
this.buttonDelete.Size = new System.Drawing.Size(32, 32);
this.buttonDelete.TabIndex = 8;
this.toolTip.SetToolTip(this.buttonDelete, "حذف");
//
// buttonSort
//
this.buttonSort.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonSort.BackgroundImage")));
this.buttonSort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonSort.Location = new System.Drawing.Point(168, 48);
this.buttonSort.Name = "buttonSort";
this.buttonSort.Size = new System.Drawing.Size(32, 32);
this.buttonSort.TabIndex = 7;
this.toolTip.SetToolTip(this.buttonSort, "ترتيب");
//
// ArrowControl
//
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));
this.Name = "ArrowControl";
this.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.Size = new System.Drawing.Size(248, 88);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

private void buttonLast_Click(object sender, System.EventArgs e)
{
UCBinder.Position = UCBinder.Count-1;
FirstRec(false);
LastRec(true);
}

private void buttonNext_Click(object sender, System.EventArgs e)
{
if(UCBinder.Position < UCBinder.Count-1)
{
UCBinder.Position++;
LastRec(false);
FirstRec(false);
}
else
LastRec(true);
}

private void buttonPrev_Click(object sender, System.EventArgs e)
{
if(UCBinder.Position > 0)
{
UCBinder.Position--;
FirstRec(false);
LastRec(false);
}
else
FirstRec(true);
}
private void buttonFirst_Click(object sender, System.EventArgs e)
{
UCBinder.Position = 0;
FirstRec(true);
LastRec(false);
}

private void FirstRec(bool able)
{
buttonFirst.Enabled = !able;
buttonPrev.Enabled = !able;
}
private void LastRec(bool able)
{
buttonLast.Enabled = !able;
buttonNext.Enabled = !able;
}

private void buttonCancel_Click(object sender, System.EventArgs e)
{
...
}

private void buttonFilter_Click(object sender, System.EventArgs e)
{
...
}

private void buttonEdit_Click(object sender, System.EventArgs e)
{
...
}
}
}

Always,
Hovik Melkomian.
GeneralRe: running function in Form from UserControl Pin
Rampas Tomas4-Aug-03 3:38
Rampas Tomas4-Aug-03 3:38 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian4-Aug-03 3:53
Hovik Melkomian4-Aug-03 3:53 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian4-Aug-03 3:22
Hovik Melkomian4-Aug-03 3:22 
GeneralRe: running function in Form from UserControl Pin
Rampas Tomas4-Aug-03 3:48
Rampas Tomas4-Aug-03 3:48 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian4-Aug-03 4:13
Hovik Melkomian4-Aug-03 4:13 
GeneralRe: running function in Form from UserControl Pin
Hovik Melkomian16-Aug-03 5:28
Hovik Melkomian16-Aug-03 5:28 
GeneralProduct Key vs ProductID Pin
CezarT31-Jul-03 1:04
CezarT31-Jul-03 1:04 
GeneralRe: Product Key vs ProductID Pin
Ista31-Jul-03 6:58
Ista31-Jul-03 6:58 
GeneralRe: Product Key vs ProductID Pin
CezarT31-Jul-03 21:42
CezarT31-Jul-03 21:42 
GeneralResource Pin
deanoA31-Jul-03 0:06
deanoA31-Jul-03 0:06 
GeneralSystem.Management is undeclared Pin
michaDam31-Jul-03 0:06
michaDam31-Jul-03 0:06 
GeneralRe: System.Management is undeclared Pin
michaDam31-Jul-03 1:04
michaDam31-Jul-03 1:04 
Questionhow can i invoke parent class in child? Pin
zecodela30-Jul-03 23:19
zecodela30-Jul-03 23:19 
AnswerRe: how can i invoke parent class in child? Pin
Arjan Einbu31-Jul-03 0:59
Arjan Einbu31-Jul-03 0:59 
AnswerRe: how can i invoke parent class in child? Pin
Ista31-Jul-03 17:30
Ista31-Jul-03 17:30 
GeneralRe: Create New Folder Pin
William Forney30-Jul-03 20:12
William Forney30-Jul-03 20:12 
GeneralRe: Create New Folder Pin
Nick Seng30-Jul-03 22:09
Nick Seng30-Jul-03 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.