c++ - how to delete the buttons "one page", "two pages" ... "six pages" in printpreviewdialog? -


i want know how delete buttons "one page", "two pages", etc, , "page" in printpreviewdialog? use c++ windows forms visual studio 2012. thanks

printpreviewdialog boilerplate implementation of dialog uses printpreviewcontrol. supposed implement own dialog if want own design.

nevertheless, can messed in .net. these buttons private members of class can't access them in own code. reflection support in .net provides backdoor, can private fields bindingflags::nonpublic. make similar (using default names):

using namespace system::reflection; ...     form1(void)     {         initializecomponent();         array<string^>^ names = gcnew array<string^> {"onepagetoolstripbutton",              "twopagestoolstripbutton", "threepagestoolstripbutton",              "fourpagestoolstripbutton", "sixpagestoolstripbutton",             "separatortoolstripseparator1"};         (int ix = 0; ix < names->length; ix++) {             fieldinfo^ fi = printpreviewdialog1->gettype()->getfield(names[ix],                  bindingflags::nonpublic | bindingflags::instance);             toolstripitem^ item = safe_cast<toolstripitem^>(fi->getvalue(printpreviewdialog1));             delete item;         }    } 

looks @ runtime:

enter image description here


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -