button.setLayoutParams(new LinearLayout.LayoutParams(10, 100));
Should have work for you.
There is one Awesome Example online for this : check this
you should apply LayoutParams of the ViewGroup that contains your View. That is, if your button is inside RelativeLayout, you should use RelativeLayout.LayoutParams