如何在vb.net中单击按钮时将字体重置为原始文件?

时间:2017-04-08 03:30:00

标签: vb.net

Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click

    txtRate.Text = "0"
    lblPromotional.ForeColor = Color.Empty
    lblPromotional.BackColor = Color.Empty
    lblPromotional.Font = originalfontname()

它不适用于字体?

2 个答案:

答案 0 :(得分:2)

如果您不想使用originalFont,那么您只需手动更改标签字体

lblPromotional.Font = New Drawing.Font("Times New Roman", 16, FontStyle.Bold)

或您使用的任何字体。以下是文档:https://msdn.microsoft.com/en-us/library/system.drawing.font(v=vs.110).aspx

答案 1 :(得分:0)

您需要在更改之前缓存整个void DealerRoll(std::array<int,3>& dealerRoll) { srand (time(NULL)); for (int dealerCount = 0; dealerCount < 3; dealerCount++) { dealerRoll[dealerCount] = rand()% 6+1; cout << dealerRoll[dealerCount] << " "; } } ... int main() { std::array<int,3> dealerRoll; cout << "Dealer's Roll: " << endl; DealerRoll(dealerRoll); ... } 对象 - 而不仅仅是字体名称。

Font