Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# ArrayList Pin
enjoycrack26-Oct-05 12:49
enjoycrack26-Oct-05 12:49 
AnswerRe: C# ArrayList Pin
Edbert P26-Oct-05 12:57
Edbert P26-Oct-05 12:57 
GeneralRe: C# ArrayList Pin
Doncp27-Oct-05 6:01
Doncp27-Oct-05 6:01 
QuestionP/Invoke problem Pin
Mark Tutt26-Oct-05 12:19
Mark Tutt26-Oct-05 12:19 
AnswerRe: P/Invoke problem Pin
leppie26-Oct-05 12:59
leppie26-Oct-05 12:59 
GeneralRe: P/Invoke problem Pin
Mark Tutt26-Oct-05 13:22
Mark Tutt26-Oct-05 13:22 
AnswerRe: P/Invoke problem Pin
leppie26-Oct-05 13:31
leppie26-Oct-05 13:31 
QuestionCalling dynamicly created buttons Pin
mwallon26-Oct-05 12:17
mwallon26-Oct-05 12:17 
Hi all, I'm new to this forum and to c# and my first project is a simple calendar for my tablet pc. In this project I dynamicly create buttons based on current month, looks like this:
private void createButtons()
{
int xet;
int numFirstDay;
DateTime myDateTime = new DateTime(activeYear,activeMonth,1);
if(myDateTime.DayOfWeek==DayOfWeek.Monday)
{
//functions for checking witch day in week the first day is }
int yet=569; int numdays =
DateTime.DaysInMonth(activeYear,activeMonth);
for(int i=1; i350)
{
yet+=20;
xet=16;
}
p.Y=yet;
p.X=xet;
aButton.Location=p;
aButton.Width=50;
aButton.Height=20;
aButton.Tag=i;
aButton.Name="button"+i;
aButton.Text=i.ToString();
if(i==activeDay)
{
aButton.BackColor = System.Drawing.SystemColors.ControlDark;
}
aButton.Click+=new EventHandler(aButton_Click);
this.Controls.Add(aButton);
xet+=50;
}
showDate();
}


This works fine and the buttons works as planned, now to my problem. When I change month from current to upcoming or earlier I like to relocate the buttons (x and y value) and hide for example button 31 if the next month only has 30 days. But I don't know how to adress these buttons from other functions?

Best Regards
Magnus
AnswerRe: Calling dynamicly created buttons Pin
enjoycrack26-Oct-05 12:51
enjoycrack26-Oct-05 12:51 
AnswerRe: Calling dynamicly created buttons Pin
Wjousts26-Oct-05 12:53
Wjousts26-Oct-05 12:53 
GeneralRe: Calling dynamicly created buttons Pin
mwallon26-Oct-05 13:16
mwallon26-Oct-05 13:16 
GeneralRe: Calling dynamicly created buttons Pin
Wjousts26-Oct-05 14:47
Wjousts26-Oct-05 14:47 
GeneralRe: Calling dynamicly created buttons Pin
mwallon27-Oct-05 11:00
mwallon27-Oct-05 11:00 
Question.NET Remoting Constructor Parameter Pin
code_dude26-Oct-05 11:03
code_dude26-Oct-05 11:03 
AnswerRe: .NET Remoting Constructor Parameter Pin
Tom Larsen26-Oct-05 11:15
Tom Larsen26-Oct-05 11:15 
GeneralRe: .NET Remoting Constructor Parameter Pin
code_dude26-Oct-05 11:46
code_dude26-Oct-05 11:46 
AnswerRe: .NET Remoting Constructor Parameter Pin
leppie26-Oct-05 12:47
leppie26-Oct-05 12:47 
QuestionCoding in C# - arrays Pin
Zjaded26-Oct-05 10:56
Zjaded26-Oct-05 10:56 
AnswerRe: Coding in C# - arrays Pin
SimonS26-Oct-05 11:03
SimonS26-Oct-05 11:03 
AnswerRe: Coding in C# - arrays Pin
enjoycrack26-Oct-05 11:05
enjoycrack26-Oct-05 11:05 
AnswerRe: Coding in C# - arrays Pin
Christian Graus26-Oct-05 11:30
protectorChristian Graus26-Oct-05 11:30 
AnswerRe: Coding in C# - arrays Pin
Wjousts26-Oct-05 13:03
Wjousts26-Oct-05 13:03 
Question.net equivilant for C function _splitpath? Pin
Dan Neely26-Oct-05 10:28
Dan Neely26-Oct-05 10:28 
AnswerRe: .net equivilant for C function _splitpath? Pin
rudy.net26-Oct-05 10:47
rudy.net26-Oct-05 10:47 
QuestionForeign key Pin
ppp00126-Oct-05 8:51
ppp00126-Oct-05 8:51 

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.