Hide some buttons

[Top]  [Chapter]  [Previous]  [Next]

The toolbar shows the new, load and save button. If you want to change the toolbar you can of course use the

application WPImagePack to edit the buttons resource file "buttons.pcc".

 

But you can also just hide one ore more buttons which listed in the XML layout description.

 

To do so you can use wpaSetFlags. This method can only be used inside the OnUpdateGUI event.

 

private int wpaNew = -1;

private void wpdllInt1_OnUpdateGUI(object Sender, int Editor, int UpdateFlags, int StateFlags, int PageNr, int PageCount, int LineNr)

{

 byte[] states = new byte[1];

 if (wpaNew<0) wpaNew = wpdllInt1.wpaGetID("New");

 states[0] = 4; // bit 3 - hide it

 wpdllInt1.wpaSetFlags(Editor,wpaNew,1, states);

}

 

 

 

 


[hidesomebuttons.htm]    Copyright © 2007 by WPCubed GmbH