Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: Public Class Pin
Colin Angus Mackay9-Apr-07 23:17
Colin Angus Mackay9-Apr-07 23:17 
GeneralRe: Public Class Pin
Colin Angus Mackay9-Apr-07 23:24
Colin Angus Mackay9-Apr-07 23:24 
Questionremoting sys(2335) Pin
kalyan_24169-Apr-07 19:13
kalyan_24169-Apr-07 19:13 
Question.net roadmap Pin
bigeyed9-Apr-07 19:02
bigeyed9-Apr-07 19:02 
AnswerRe: .net roadmap Pin
Jaiprakash M Bankolli9-Apr-07 20:08
Jaiprakash M Bankolli9-Apr-07 20:08 
QuestionHelp me to develop cool date picker.[Windows] Pin
Sendilkumar.M9-Apr-07 18:58
Sendilkumar.M9-Apr-07 18:58 
AnswerRe: Help me to develop cool date picker.[Windows] Pin
Christian Graus9-Apr-07 19:05
protectorChristian Graus9-Apr-07 19:05 
GeneralRe: Help me to develop cool date picker.[Windows] Pin
Sendilkumar.M9-Apr-07 22:23
Sendilkumar.M9-Apr-07 22:23 
Thats what my problem is.I Set the button's left as form's left and button's top+buttons'height as form's top.
This is the logic.

protected override void OnClick(EventArgs e)
{
SetAutoLocation();
frmCal.Show();
Invalidate();

}

private void SetAutoLocation()
{

Rect rect;
GetWindowRect(this.Handle, out rect);
Point tergatePoint;
tergatePoint = new Point(rect.left, rect.top + this.Height);
tergatePoint = new Point(Left, Top + Height);
if (rect.left + this.Width - frmCal.Width < 0)
{
tergatePoint.X = 0;
}
else
{
tergatePoint.X = rect.left - frmCal.Width + this.Width;
}
if (tergatePoint.X + frmCal.Width > System.Windows.Forms.SystemInformation.WorkingArea.Right)
{
tergatePoint.X = System.Windows.Forms.SystemInformation.WorkingArea.Right - frmCal.Width;
}
else if (tergatePoint.X < 0)
tergatePoint.X = 0;
if (tergatePoint.Y + frmCal.Height > System.Windows.Forms.SystemInformation.WorkingArea.Bottom)
{
tergatePoint.Y = rect.top - frmCal.Height;
}
if (tergatePoint.Y < 0)
{
tergatePoint.Y = 0;
}
if (tergatePoint.X < 0)
{
tergatePoint.X = 0;
}
frmCal.Location = tergatePoint;
}


public struct Rect
{
internal int left, top, right, bottom;
}


First click form is not positioning well ,but from second click onwards it is working fine.
Can you just see that logic is correct or not?

M.Sendilkumar

QuestionDataGridView in c# Pin
719-Apr-07 18:58
719-Apr-07 18:58 
AnswerRe: DataGridView in c# Pin
Nader Elshehabi9-Apr-07 23:36
Nader Elshehabi9-Apr-07 23:36 
QuestionIs it possible to change the image in ContextMenu? Pin
Khoramdin9-Apr-07 15:32
Khoramdin9-Apr-07 15:32 
AnswerRe: Is it possible to change the image in ContextMenu? Pin
Nader Elshehabi9-Apr-07 16:08
Nader Elshehabi9-Apr-07 16:08 
QuestionAny snippet code for calling CoCreateGuid ??? Pin
LongRange.Shooter9-Apr-07 14:07
LongRange.Shooter9-Apr-07 14:07 
AnswerRe: Any snippet code for calling CoCreateGuid ??? Pin
Nader Elshehabi9-Apr-07 14:09
Nader Elshehabi9-Apr-07 14:09 
QuestionByte[] to HexString Pin
AAKAra9-Apr-07 12:52
AAKAra9-Apr-07 12:52 
AnswerRe: Byte[] to HexString Pin
Luc Pattyn9-Apr-07 14:04
sitebuilderLuc Pattyn9-Apr-07 14:04 
GeneralRe: Byte[] to HexString Pin
a_anilkumar110-Apr-07 15:38
a_anilkumar110-Apr-07 15:38 
AnswerRe: Byte[] to HexString Pin
Leslie Sanford9-Apr-07 14:06
Leslie Sanford9-Apr-07 14:06 
AnswerRe: Byte[] to HexString Pin
stancrm9-Apr-07 22:55
stancrm9-Apr-07 22:55 
AnswerRe: Byte[] to HexString Pin
stancrm10-Apr-07 21:02
stancrm10-Apr-07 21:02 
QuestionStarting a timer after another object's event has been fired. Pin
Ylno9-Apr-07 12:29
Ylno9-Apr-07 12:29 
AnswerRe: Starting a timer after another object's event has been fired. Pin
Leslie Sanford9-Apr-07 13:34
Leslie Sanford9-Apr-07 13:34 
GeneralRe: Starting a timer after another object's event has been fired. Pin
Ylno9-Apr-07 21:13
Ylno9-Apr-07 21:13 
GeneralRe: Starting a timer after another object's event has been fired. Pin
Leslie Sanford10-Apr-07 0:22
Leslie Sanford10-Apr-07 0:22 
QuestionInvalidate() Pin
max292979-Apr-07 11:59
max292979-Apr-07 11:59 

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.