Elastocapillary Behavior And Wettability Control In Nanoporous Microstructures