How can I style each of the children in the msgbox?

Nothing optimal here, and there may be better ways, but a couple of things that would work:

The button matrix button width is ‘automatic’, so you could add a couple of “blank” buttons and hide them:

static const char * btns[] = {"Blank", "Close", "Blank", ""};

and then after calling lv_msgbox_add_btns:

lv_btnmatrix_set_btn_ctrl(lv_msgbox_get_btnmatrix(mbox1), 0, LV_BTNMATRIX_CTRL_HIDDEN);
lv_btnmatrix_set_btn_ctrl(lv_msgbox_get_btnmatrix(mbox1), 2, LV_BTNMATRIX_CTRL_HIDDEN);

Or, don’t add the btn_matrix via lv_msgbox_add_btns at all, and instead create and style your own button on the msgbox, adding it after the label:

lv_obj_t * btn1 = lv_btn_create(mbox1, NULL);
lv_obj_t * btnlabel = lv_label_create(btn1, NULL);
lv_label_set_text(btnlabel, "Close");
lv_obj_set_width(btn1, 80);
lv_obj_add_style(btn1, LV_BTN_PART_MAIN, &style_button);

This works, but it’s getting very unmsgboxy :slight_smile:

For the spacing of your label, try looking at the sources for the message box and experiment with the padding of various elements, unless someone else can chime in with a better solution.