Example using "Common Controls"

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
Originally posted by freak


Windows XP: The year cannot be greater than 30827.
This is really, really BAD :)

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Paul, I suppose the text of the button should be 'Get Date' :)

Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Well, I was going to go all the way and have time&date but I thought everyone could figure it out from here.

Hehe... what can I say?! :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TerryHough.

Thanks Paul,

That got me cleared up on the syntax and rolling on.

Thanks to all who have helped.

Terry
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Does this make a little more sense?

Thanks, Freak and Paul!


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by horst.

Thanks to all who posted the know-how for the Calendar.

I have added the calendar window to my little date reminder.

http://home.mnet-online.de/horst.muc/win/reminder.zip

Bug reports and any help with language files appreciated
(currently only German and English available)

And I have a question:
Is there any way to change the calendar colors?



Horst
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

> And I have a question:
> Is there any way to change the calendar colors?

Yes, nearly everything can be done in some way... :)

Here we go:

Code: Select all

SendMessage_(hCal, #MCM_SETCOLOR, #MCSC_BACKGROUND, $000000)
This sets the backgroundcolor to black.
The $000000 can be relpaced with any RGB value you like (just like the HTML colors)

#MCSC_BACKGROUND can be replaced with the following constants:

#MCSC_BACKGROUND
Set the background color displayed between months.
#MCSC_MONTHBK
Set the background color displayed within the month.
#MCSC_TEXT
Set the color used to display text within a month.
#MCSC_TITLEBK
Set the background color displayed in the calendar's title.
#MCSC_TITLETEXT
Set the color used to display text within the calendar's title.
#MCSC_TRAILINGTEXT
Set the color used to display header day and trailing day text. Header and trailing days are the days from the previous and following months that appear on the current month calendar.

Code: Select all

;Constant definition:
#MCM_SETCOLOR = $100A  ; wrong value last time, sorry.
#MCSC_BACKGROUND = 0
#MCSC_TEXT = 1
#MCSC_TITLEBK = 2
#MCSC_TITLETEXT = 3
#MCSC_MONTHBK = 4
#MCSC_TRAILINGTEXT= 5
You can change this stuff anywhere after the CreateWindowEx_() command.

That's it...

Timo

--------------------------------
Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs and the universe trying to produce bigger and better idiots.

...So far, the universe is winning.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by horst.

> SendMessage_(hCal, #MCM_SETCOLOR, #MCSC_BACKGROUND, $000000)

freak,

I have tried everything, but there is absolutely no effect (Win98SE).
The SendMessage to preset the date works all right, though.

Any idea?


Horst
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by freak.

Sorry, that was my fault!
The Value I gave you for #MCM_SETCOLOR was wrong.

It should be $100A

I should have tested what i was writing, but i had no time... sorry.

Timo
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by horst.


> It should be $100A

Yep, that did it.
Thanx


Horst
Post Reply