如何限制文本框添加其他值 [英] how to restrict a textbox to add another value

查看:83
本文介绍了如何限制文本框添加其他值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有两个表,一个是class master,另一个是stream master.当我创建类时,它具有选择select class和select stream(例如医学,非医学,艺术,商业,无stream)的选项.选择任何流并保存该类,但是在下一次,如果有人想选择另一个流到同一类中,则不允许该类添加另一个流.这将是可能的.


感谢您的问候,
Amit Mehan

Hello All,
I have two tables one is class master and other is stream master.when i will create class it has options select class and select stream(like medical,non-medical,arts,commerce,no stream).I want that when a particular class select any stream and save that class But in next time if somebody wants to select another stream to same class ,it would not allow that class to add another stream.how it will be possible.


Thanks with Regards,
Amit Mehan

推荐答案

首先使用文件流读取器和写入器技术保存设置,并将其保存在.txt文件中.下次当您尝试加载它时.在表单加载中,如果文本文件具有值(学生选择了ex的艺术流),则仅使文本框正确地启用ENABLED = False(textBox1.Enabled = false)..

如果您有任何疑问,请给我我将编写的代码并向您解释,好的,请联系viswa.teja @ ymail.com,viswa.teja @ live.in,viswa.teja1991 @ gmail.com:cool:
First Save the setting using filestream reader and writer technique and save it in .txt file. Next time when u try to load it. In Form load if text file has a value(a student selected a stream for ex arts ) Then just make the textbox propery ENABLED=False(textBox1.Enabled=false)..

If you have any doubts give me the code i will write and explain you ok MAil me at viswa.teja@ymail.com,viswa.teja@live.in,viswa.teja1991@gmail.com:cool:


做一件事会自动增加类ID,以使没有人得到相同的类ID仪式
在sql中给列ID class_Id int NOT NULL AUTO_INCREMENT.这样您就不必禁用文本框
Do one thing auto increment the class id so that no one gets same class id rite
Give the coulmn id class_Id int NOT NULL AUTO_INCREMENT in sql. so that you need not to disable textbox


,或者做一件事来检查class_id,以及该类ID是否已存在于db中.只是禁用文本框.....
Or Do one thing cheak the class_id and if that class id already present in db. just disable the textbox.....


这篇关于如何限制文本框添加其他值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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