Jump to content
Xtreme .Net Talk

King Erik I

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by King Erik I

  1. Errr.... I think if you use the .NET Compact Framework, yes. Becouse that is a standard for writing applications for a Pocket PC... Do you mean a Pocket PC with the operating system Pocket PC 2002/2003 or another type of PDA.
  2. Lol... I am going to write it from the beginning... the days should be clickable. Then there will be two other problems. How do I know which day is clicked and how can I see how many appointments are there on that day? (extra label on button?) :mad: :mad: :mad:
  3. I know, Thanks... There are some problems which i can't solve i think becouse of the compact framework :( When I click a daynumber there should be a query triggered with the current date and show the appointments. Not possible with a label... Another problem is that the screen should be refreshed. I've got an idea, just create all the colums and first fill them with "" (nothing), after that fill them with the day number. Tomorrow another day. But then they arent still clickable... Maybe There will be a miracle this evening and I will get a solution for this prob :D [edit]My calendar is not slow on PPC :cool: :) :D [/edit]
  4. Thank you very much for your reaction. I've added a screenshot of the calendar. The blue border is the first layer, a panel... The white background inside the blue border is the second layer, a panel The text is the third layer, a label So you will see the layout of it... thats the problem i've got. The position of the panels+labels who have to be re-positioned. :mad: Im going to check how my calendar acts on my pocket PC. :)
  5. It worked... only now i've got another problem... when i want to switch to another month the calendar is very slow and the days which have been created wont dissapear. Posted it on http://www.xtremedotnettalk.com/showthread.php?t=85224 :-(
  6. Hello, I've written a calendar for the pocket pc. The problem is that this one is very slow and when i jump a month back or forward, the created days from that previous month won't dissapear. Is there any way to remove all the created 'txt' labels? And what about the speed... I am just a simple beginnen, but i have to create it for my work... am a trainee :p Private Sub Calendar() 'ByVal iYear As Integer, ByVal iMonth As Integer, ByVal iDay As Integer) System.Windows.Forms.Cursor.Current.Current = System.Windows.Forms.Cursors.WaitCursor() Dim iDaysInMonth As Integer 'The number of days in a month Dim iCurrentDay As Integer = 1 'The current day... necessary for the loop Dim iDowStart As Integer 'Declare daysofweek from the 1st day of the month Dim iBoxDimension As Integer = 30 'The width of the text box with the day number in it. Dim iBoxPosX, iBoxPosY As Integer 'The position of the box which is going to be created Dim iTxtPoxX, iTxtPoxY As Integer 'The position where the day should be placed. iDaysInMonth = Now.DaysInMonth(iYear, iMonth) iDowStart = DateTime.Now.Parse(iYear & "/" & iMonth & "/01").DayOfWeek + 1 'The number of the Day Of Week for the 1st of the month iTxtPoxX = iDowStart 'Initize with the Day Of Week start iTxtPoxY = 1 'Initize with 1 Do Until iCurrentDay > iDaysInMonth Dim pnlBorder As Panel 'Create a panel for the border pnlBorder = New Panel Dim pnlBack As Panel 'Create a panel for the background pnlBack = New Panel Dim txt As Label 'Create a label txt = New Label txt.Refresh() iBoxPosX = ((iTxtPoxX * iBoxDimension) + (iTxtPoxX)) - iBoxDimension iBoxPosY = ((iTxtPoxY * iBoxDimension) + (iTxtPoxY)) - iBoxDimension With pnlBorder 'Panel is border for the label .Location = New Point(iBoxPosX, iBoxPosY) .Size = New Size(iBoxDimension + 2, iBoxDimension + 2) .BackColor = Color.DarkBlue .Visible = True End With With pnlBack 'Panel is background for the label .Location = New Point(1, 1) .Size = New Size(iBoxDimension, iBoxDimension) .BackColor = Color.White .Visible = True End With With txt 'Create label for the number of the day .Location = New Point(0, 0) .Size = New Size(iBoxDimension, iBoxDimension) .Text = iCurrentDay .Visible = True .ForeColor = Color.Firebrick End With Me.Controls.Add(pnlBorder) pnlBorder.Controls.Add(pnlBack) pnlBack.Controls.Add(txt) iCurrentDay += 1 iTxtPoxX += 1 If iTxtPoxX = 8 Then iTxtPoxX = 1 iTxtPoxY += 1 End If Loop System.Windows.Forms.Cursor.Current.Current = System.Windows.Forms.Cursors.Default() End Sub
  7. What i can do also is just create behind a label a panel... ;-) think im going to do that. A border around a calendar day is handy :-P
  8. Hello, does anyone knows how to get a border around a label or change the backcolor of it?? The property (backcolor) is there, but when I set it there is no result :-S lblTesting.BackColor = Color.Red
  9. Great!! it's working :-D Thanks alot... Declare = Dim something... doh... stupid me sometimes :o)
  10. Name 'txt' is not declared.... my VS 2003 .NET Pro says.... I Declare it under the Do Until loop txt = New Label ...Gmbl...
  11. Hmmm... ok :) shall test it again
  12. Hello, having a small problem.... Want to create my label dynamicly. Found another post on this forum where i have found the info with the With function, so that worked.... only now i've got another small problem. If I run my loop, the previous created label is gone! That is not what I want. How do I create something so that every created label stays? Under here my current code.... Dim iDaysInMonth As Integer 'The number of days in a month Dim iCurrentDay As Integer = 1 'The current day... necessary for the loop Dim iDowStart As Integer 'Declare daysofweek from the 1st day of the month Dim iTxtBoxWidth As Integer = 24 'The width of the text box with the day number in it. Dim iTxtBoxPos As Integer iDaysInMonth = Now.DaysInMonth(Now.Year, Now.Month) iDowStart = DateTime.Now.Parse(Now.Year & "/" & Now.Month & "/01").DayOfWeek + 1 ' MessageBox.Show(iDowStart) Do Until iCurrentDay = iDaysInMonth txt = New Label iTxtBoxPos = (iCurrentDay * iTxtBoxWidth) + (iCurrentDay) 'MessageBox.Show(iCurrentDay) With txt 'Not correct?? .Location = New Point(iTxtBoxPos, 15) .Size = New Size(24, 24) .Text = iCurrentDay .Visible = True .BackColor = Color.Red End With Me.Controls.Add(txt) iCurrentDay += 1 Loop
  13. Aha.... i was very close to the solution. ;-) thanks a lot.
  14. Typecasting (int) doen't work here. When i leave it, i will get the name of the day. int(date.DayOfWeek)) also doesn't work... I need the day number. p.s. date is reserved word :-)
  15. No... i want the number of that day.... sunday = 1, monday = 2, e.g. I am writing a calendar for a pocket pc and i don't wanna use 3rd party components. Any suggestions maybe?
  16. Hey, Here me is again :o) I want to get the DayOfWeek from the first day of any month.... I've got something like this: Dim iDowStart As Integer iDowStart = DateTime.Parse(Now.Year + "/" + Now.Month + "/01").DayOfWeek This isn't working. Does somebody knows a solution for this problem? [offtopic]When i previewed my post, explorer crashed :confused: [/offtopic] Thanks in advance,
  17. aah ok :-) The reason I've posted that code was becouse my collegae has programming experience in VB6.... I am pretty new to VB... ;-)
  18. What is the advantage of the piece of code what you've posted... ... against mine? I am just a starting VB programmer and learning a lot at this moment.... Any suggestions are welcome!
  19. Got it :-D Label2.Text = Mid(Format(System.DateTime.Now, "M"), 1, 3)
  20. Hello, how do I set the max length of a string?? Becouse I have a string which is filled with the name of the month and I just want the first three letters.... :confused: Greetings
  21. I've read about a 'Pocket PC Calendar plug-in'. Didn't find it yet, maybe I am going to look for it.
  22. Alright... I will look monday... weekend is starting now :cool: ... maybe tomorrow .. ty.
  23. Hello, Need to create a calendar for an application for a Pocket PC and I just can't find the Calendar control anywhere or the MonthCalendar control :confused: Import System.Window.Forms.MonthCalendar Will be blue underlined and says Namespace or type 'MonthCalendar' for the Imports 'System.Windows.Forms.MonthCalendar' cannot be found I don't have a calendar icon either when i view the design screen. Can somebody please help me to tell me what to do?
×
×
  • Create New...