本文介绍了乘法没有成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Dim PlayaSeptemberWeekday 作为 整数 = 100 Dim PlayaSeptemberWeekend 作为 整数 = 150 私人 Sub cmbHotel_SelectedIndexChanged(sender As Object ,e As EventArgs)句柄 cmbHotel.SelectedIndexChanged 如果(cmbHotel.Text = Playa del Mar)和(cmbMonth.Text = 9月)然后 txtWeekday.Text = PlayaSeptemberWeekend 结束 如果 结束 Sub 私有 Sub cmbWeekdays_SelectedIndexChanged(sender As 对象,e As EventArgs)句柄 cmbWeekdays.SelectedIndexChanged Dim cmbWeekdays 作为 整数 = 2 或 3 或 4 或 5 或 1 如果 cmbWeekdays = 1 然后 txtWeekday.Text = cmbWeekdays * PlayaSeptemberWeekday 结束 如果 结束 Sub 结束 Class 基本上我有一个组合框,我需要做到这一点在组合框中选择1或2或3或4或5我需要它乘以100.任何人都知道我在哪里错了?解决方案 你需要认真阅读一些语言文档/教程。 你的代码看起来就好像你抛出几乎随机的代码而感到惊讶它不起作用。我在你的代码中看到至少6个错误。 我想你也需要提高你的编程技巧。 Dim PlayaSeptemberWeekday As Integer = "100" Dim PlayaSeptemberWeekend As Integer = "150" Private Sub cmbHotel_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbHotel.SelectedIndexChanged If (cmbHotel.Text = "Playa del Mar") And (cmbMonth.Text = "September") Then txtWeekday.Text = PlayaSeptemberWeekend End If End Sub Private Sub cmbWeekdays_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbWeekdays.SelectedIndexChanged Dim cmbWeekdays As Integer = "2" Or "3" Or "4" Or "5" Or "1" If cmbWeekdays = "1" Then txtWeekday.Text = cmbWeekdays * PlayaSeptemberWeekday End If End SubEnd ClassBasically I have a combo box, and I need to make it when a 1 or 2 or 3 or 4 or 5 is selected in the combobox I need it to multiply by 100. Anyone know where I'm going wrong here?? 解决方案 You need some serious reading of the language documentation/tutorials.Your code look like if you throw almost random pieces of code and get surprised it don't work. I see at least 6 errors in your code.I guess you need to improve your programming skills too. 这篇关于乘法没有成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 07:32