可以将文本标签的输出控制变量初始化为滑块控件的int吗? [英] can we initialise an output Control Variable of the Text Label as int for slider control?

查看:73
本文介绍了可以将文本标签的输出控制变量初始化为滑块控件的int吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以将文本标签的输出控制变量初始化为int而不是cstring进行滑块控制吗?

我做了一个滑块控件和一个字符串类型的文本标签来控制滑块.我给像这样的范围slider1.SetRangeMin(0,false); Slider1.SetRangeMax(9,false);但是当我移动滑块时它仍然显示0-100.我想给出条件if(slidervalue =="50")但==不能与字符串一起使用.因此,我正在考虑将控制变量初始化为int类型,这就是为什么要问这个问题.

can we initialise an output Control Variable of the Text Label as int instead of cstring for slider control ????

i have made a slider control and a text label of type string to control slider. i give the range like that slider1.SetRangeMin(0, false); slider1.SetRangeMax(9, false); but it still shows 0-100 when i move the slider. i wanna give a condition if(slidervalue=="50") but == doesnot use with strings. so i am thinking of initialising control variable as int type thats why asking this.

推荐答案

Sweety汗写道:
Sweety Khan wrote:

正在等待........

waiting........



无需添加这样的注释;当有人有话要说时,您的查询就会得到答复.

至于您的实际问题,目前尚不清楚您要做什么.请尝试重新措词以更详细地说明您的问题.



There is no need to add comments like this; your query will get answered when someone has something useful to say.

As to your actual question it is not clear what you are trying to do. Please try and rephrase to explain your problem in better detail.


如果要将标签文本与整数进行比较,则必须将该字符串转换为int类型.

GetDlgItemtext(phWnd,ItemID,lBuf);

int lVal = wtoi(lBuf);

现在您可以比较这些值了.

希望对您有帮助.
if you want to compare the label text to the integer then u have to convert that string to the int type.

GetDlgItemtext(phWnd, ItemID, lBuf);

int lVal = wtoi(lBuf);

now you can compare those values.

hope this helps you.


这篇关于可以将文本标签的输出控制变量初始化为滑块控件的int吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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