GodFather1
یک شنبه 21 شهریور 1395, 15:47 عصر
سلام
من در حال نوشتن یه برنامه محاسبه نمرات هستم
مشکلم فقط اینجاست که مثلا میخوام کلمه "قبولی" رو با رنگ سبز توی لیست باکس نشون بده و کلمه "رد" رو با رنگ قرمز نشون بده.
از کد زیر استفاده کردم
If c > 70 Then
ListBox2.Items.Add(": Passed")
ListBox2.ForeColor = Color.Green
End If
If c < 70 Then
ListBox2.Items.Add(":NotPassed!")
ListBox2.ForeColor = Color.Red
End If
بعدش که نمره رو وارد می کنم و کلیک می کنم کلمه "passed " به رنگ سبز توی لیست باکس نشون داده میشه
وقتی نمره پایین تر رو وارد می کنم کلمه "Not passed" قرمز میاد توی لیست باکس
مشکل اینجاست که "passed" هم توی لیست باکس رنگش قرمز میشه
اگه سورسی یا روشی هست ممنون میشم
من در حال نوشتن یه برنامه محاسبه نمرات هستم
مشکلم فقط اینجاست که مثلا میخوام کلمه "قبولی" رو با رنگ سبز توی لیست باکس نشون بده و کلمه "رد" رو با رنگ قرمز نشون بده.
از کد زیر استفاده کردم
If c > 70 Then
ListBox2.Items.Add(": Passed")
ListBox2.ForeColor = Color.Green
End If
If c < 70 Then
ListBox2.Items.Add(":NotPassed!")
ListBox2.ForeColor = Color.Red
End If
بعدش که نمره رو وارد می کنم و کلیک می کنم کلمه "passed " به رنگ سبز توی لیست باکس نشون داده میشه
وقتی نمره پایین تر رو وارد می کنم کلمه "Not passed" قرمز میاد توی لیست باکس
مشکل اینجاست که "passed" هم توی لیست باکس رنگش قرمز میشه
اگه سورسی یا روشی هست ممنون میشم