Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi all,
 
     I have a from consisting of 8 controls(textbox and combo) and i had to use this form for several reports.Based on particular report i have to enable or disable the controls.How can i do this dynamically..

Any one help me out..

Thanks in advance..
Posted 12-Dec-12 20:51pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could do it as.........

Using text value based conditions in your report
Textbox1.enabled = (Condition_In_Report = "Text_Value")

Using Numeric based values in your report
Combo1.Enabled = (Condition_In_Report = 6 or 9 or (12 and 3))

Just replace the numeric or text values that decide wether the control should be enabled or disabled.
 
Textbox2.Enabled = (Budget < Maximumvalue or Today = "Monday")  

You always mix and match too
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

select case lstrreportname
case "Sales Summary"
text1.enable = false
label1.enable = false
text2.enable = true
lable2.enable = true
csae "Collection Report"
text1.enable = true
label1.enable = true
text2.enable = false
lable2.enable = false

...
end select
  Permalink  
Comments
DileepkumarReddy at 13-Dec-12 2:39am
   
Hi,I have got this idea..is there any other way that is dynamic than this?...

Thank You
kgmmurugesh at 14-Dec-12 0:13am
   
No, this is the best & easy way. Other wise you use tables to stores report name and Text name to do this process.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210


Advertise | Privacy | Mobile
Web04 | 2.8.150331.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100