TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
magnuswallon
NA
1
0
Dynamic buttons
Oct 26 2005 5:58 PM
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; i
350) { 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 }
Reply
Answers (
0
)
system.object
GDI+ Animation in dotnet