Generate Paint event; color menu items 
Author Message
 Generate Paint event; color menu items

I'm tinkering with creating a game in VB, prior to trying to write some
"real" apps, as a learning exercise.  Two questions I can't find the
answer to either in any of the manuals or in the FAQ.

1) How do I generate a paint event.  When a new game is initialized,
I want to clear the form of the graphics that have been created and
regenerate them based on the current settings.  MyForm.Hide followed
by MyForm.Show works, but seems really klungy.

2) Is there some (reasonably straightforward) way to do color menu items,
either as colored text or as color swatches?  I've a color selection
menu implemented as a popup that would be nice to have with "red"
in RED, for example.


                        Eastman Chemical Company



Tue, 08 Jul 1997 21:16:34 GMT  
 Generate Paint event; color menu items

: 1) How do I generate a paint event.  When a new game is initialized,
: I want to clear the form of the graphics that have been created and
: regenerate them based on the current settings.  MyForm.Hide followed
: by MyForm.Show works, but seems really klungy.

 You can issue a Call to the Form_Paint subroutine.  Just be careful you
don't cause a cascading event.

: 2) Is there some (reasonably straightforward) way to do color menu items,
: either as colored text or as color swatches?  I've a color selection
: menu implemented as a popup that would be nice to have with "red"
: in RED, for example.

 I think I saw once in the Knowledge base a method for changing the font
in the menus (maybe it was in Dan Appleman's Guide to the Windows API);
it may be possible to change colours the same way.  Problem is that all
my ref. material is at work, so I can't go hunting for the info right now...



Wed, 09 Jul 1997 08:55:15 GMT  
 Generate Paint event; color menu items


BE>I'm tinkering with creating a game in VB, prior to trying to write
BE>some "real" apps, as a learning exercise.  Two questions I can't
BE>find the answer to either in any of the manuals or in the FAQ.

BE>1) How do I generate a paint event.  When a new game is initialized,
BE>I want to clear the form of the graphics that have been created and
BE>regenerate them based on the current settings.  MyForm.Hide followed
BE>by MyForm.Show works, but seems really klungy.

Use the Refresh method (AutoRedraw = False).

BE>2) Is there some (reasonably straightforward) way to do color menu
BE>items, either as colored text or as color swatches?  I've a color
BE>selection menu implemented as a popup that would be nice to have
BE>with "red" in RED, for example.

Why not use the common dialogs?


Ian C.    Compuserve: 100435,3040     FidoNet Netmail: (2:259/17)
          Tel/Fax: (+44)(0)1909-773689
---
 * POW 1.2  0028 * Thank you for holding your breath while I smoke.



Thu, 10 Jul 1997 01:49:00 GMT  
 Generate Paint event; color menu items

Quote:

>Subject: Generate Paint event; color menu items
>Date: Fri, 20 Jan 95 13:16:34 GMT
>I'm tinkering with creating a game in VB, prior to trying to write some
>"real" apps, as a learning exercise.  Two questions I can't find the
>answer to either in any of the manuals or in the FAQ.
>1) How do I generate a paint event.  When a new game is initialized,
>I want to clear the form of the graphics that have been created and
>regenerate them based on the current settings.  MyForm.Hide followed
>by MyForm.Show works, but seems really klungy.

I THINK you'd have to use the api sendmessage.  Find the constant for
wm_paint, and send that message to your app.

Quote:
>  Is there some (reasonably straightforward) way to do color menu items,
>either as colored text or as color swatches?  I've a color selection
>menu implemented as a popup that would be nice to have with "red"
>in RED, for example.

I don't think there is an easy way.  There might not be a way.  What you would
have to do is use message blaster or something like that to trap the wm_paint
message for the menu, and then paint the menu yourself using the colours u
want.  

Maybe you could change the system colours just before displaying the menu.

TTYL

Hope I've been of some help.

Alex Black



Sat, 12 Jul 1997 19:46:55 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Paint title bar, menus etc.. (Change Color)

2. Adding Menu item to the Mail item menu from an outlook Addin

3. Adding Menu item to the Mail item menu from an outlook Addin

4. Font Color in a Menu Item

5. Invling a menu items onaction event

6. adding onclick events to dynamically created menu items

7. Adding Events to context menu items

8. Adding Menu Items at runtime and handle their events

9. MouseOver Event for Menu Item

10. Getting event from appended control menu item

11. Excel, paint image for item in DropDownList of CommandBarComboBox

12. TreeView paints background of items grey when disabled

 

 
Powered by phpBB® Forum Software