如何在 Visual Basic 6.0 中反向显示输入整数 [英] How to show the input integer in reversed in Visual Basic 6.0

查看:50
本文介绍了如何在 Visual Basic 6.0 中反向显示输入整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!我在 Visual Basic 6.0 中遇到问题.

Good day! I have a problem in Visual Basic 6.0.

我创建了两个 textbox,一个用于输入,一个用于输出.

I created two textboxs, 1 for input and one for output.

输出应该与输入相反.

示例:

输入:345
输出:543

Input : 345
Output : 543

这是我目前编写的代码.

This is what I've coded so far.

Dim rev, n As Integer
rev = Val(Text1.Text)
rev = rev * 10
rev = rev + n Mod 10
n = n / 10
Text2.Text = n

每当我单击命令按钮时,无论在我的输入中输入什么值,它都只会返回 0.

Whenever I click the command button, it just returns 0 no matter what value entered in my input.

推荐答案

你可以使用这个:

Text2.Text = StrReverse(Text1.Text)

这篇关于如何在 Visual Basic 6.0 中反向显示输入整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆