on 07-01-2015 12:53 PM
Hi, everybody
I am developing an SDK application using VB.NET.
My first Screen is called "Selection Criteria" (a simplified picture is shown below)
If we press "OK", another form opens, with a few tabs (folders)
Which tab opens will depend on which Option buttons have been clicked.
Each folder is associated with a grid or a series of objects (Edit Texts, Combo Boxes etc)
Each folder is independent of the other folders. My application can be regarded as a number of applications put together under one roof for convenience, although they all use the parameters set in the Selection Criteria screen.
Which application is fired depends on which Option buttons are clicked on the Selection Criteria Screen.
I am writing my code in a single class, and I am rather concerned that my code is getting very long (now above 5000 lines)
My concerns are (1) readability (2) ease of maintenance (3) simplicity of code.
I wish to know if using CLASS can help me write more readable code.
Or is using MODULE more appropriate?
I never programmed with MULTIPLE CLASSES before. I am reading as much as I can about CLASS.
Can I use a separate class to hold the code for each folder (Tab1, Tab2, Tab3, etc) ?
How can I program VB.NET so that when (say) if I click Option button 1 and Option button 2, this runs the code for Folder1?
Please offer some general advice or links to relevant sites to initiate me on the subject.
Thanks
Leon Lai
Hi Leon,
If I am getting you correctly then I would suggest you to have a look at the Partial Class in C#.
Althogh I have never tried this as you want. I generally write everything in a single class for a single form.
Still you can have a look on the concept of the partial class.
Hope it helps.
Thanks & Regards
Ankit Chauhan
SAP Business One Global Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
Thanks a lot for your reply.
I use VB.NET rather than C#. Nevertheless I will search for "Partial Class" as suggested
Let me rephrase my question:
My problem is that my code is becoming too long to read and understand.
I want to break it down into manageable parts (as my application is in fact a series of separate applications). Still I want all these different applications to be grouped under one roof, for user convenience..
How can I do that?
Should I use different CLASSES?
or Should I use different MODULES
or Should I use another technique? Which one?
Best Regards
Leon
Hi Leon,
You can search it on Google to find it in VB .Net.
Also as far as your question is concerned, you can try with the partial class.
Here is little about it:
It splits the definition of a class over two or more source files. You can create a class definition in multiple files but it will be compiled as one class.
Hope it helps.
Thanks & Regards
Ankit Chauhan
SAP Business One Global Support
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.