Location Change
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
WTF :wtf:
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
How?
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
I don't get it.
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
I didn't tried this but i suppose it doesn't do anything :) after it changes the position it changes back to the initial position, i suppose ...
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
-
try this
private void Form_Load(object sender, EventArgs e)
{
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
}private void PayTextBox_LocationChanged(object sender, EventArgs e)
{
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;
}Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
Not tested, but I'm really sure it does the following: It sets the correct top position at startup, but it lets the left position unchanged. If PayTop is not initialized, the window will always be opened at the top of the screen. This will be the execution plan I think:
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
// triggers ->
objChequeTemplate.PayLeft = ((Control)sender).Left; // left is current left window position
objChequeTemplate.PayTop = ((Control)sender).Top;
// returns
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
// triggers ->
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;Greetings Covean
-
Not tested, but I'm really sure it does the following: It sets the correct top position at startup, but it lets the left position unchanged. If PayTop is not initialized, the window will always be opened at the top of the screen. This will be the execution plan I think:
this.PayTextBox.LocationChanged += new System.EventHandler(this.PayTextBox_LocationChanged);
this.PayTextBox.Top = this.objChequeTemplate.PayTop;
// triggers ->
objChequeTemplate.PayLeft = ((Control)sender).Left; // left is current left window position
objChequeTemplate.PayTop = ((Control)sender).Top;
// returns
this.PayTextBox.Left = this.objChequeTemplate.PayLeft;
// triggers ->
objChequeTemplate.PayLeft = ((Control)sender).Left;
objChequeTemplate.PayTop = ((Control)sender).Top;Greetings Covean