Controls Based Security in a Windows Forms Application using VB.NET - vb.net

I need to implement, Controls Based Security in a Windows Forms Application using VB.NET. I tried google but did not get anything much to work with.
I would like if someone, could suggest some books or tutorials.
Thanks

I'd recommend looking at Jesse Liberty's very detailed article: Controls Based Security in a Windows Forms Application, which includes full source and demonstrates one nice approach to this problem. While the article is in C#, the concepts should all translate to VB.NET exactly.

Related

VB6 Parser/Lexer/Scripter

I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them.
I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before.
My question is:
Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?
Use the Microsoft® Windows® Script Control because it is easy to integrate into existing VB6 applications. The control supports VBScript, JScript, or any other "Active Script" implementation.
I have used the Windows Script Control in four projects and it works extremely well. Very easy to integrate. I wish Microsoft would have given us a replacement in .NET, and made it as easy to use. (I understand the control is not needed in .NET, but having the ability to simply create an object that handles everything is nice.)
Windows Script Control
The Microsoft® Windows® Script Control
is an ActiveX® control that provides
developers with an easy way to make
their applications scriptable. This,
in turn, enables users to extend
application functionality through
scripts, much as they do with macros
today.
INFO: Where to Obtain the Script Control at http://support.microsoft.com/kb/184739. Includes links to other howto support articles.
Chapter 13: Adding Scripting Support to Your Application at http://msdn.microsoft.com/en-us/library/aa227413(VS.60).aspx
Designing a Calculator at http://msdn.microsoft.com/en-us/library/aa227421(VS.60).aspx
How To Use Script Control Modules and Procedures Collections, Inserted from http://support.microsoft.com/kb/184745
How To Use the AddObject Method of the Script Control, Inserted from http://support.microsoft.com/kb/185697
SAMPLE: SCRIPTEX.EXE Uses the ScriptControl with Visual Basic, Inserted from http://support.microsoft.com/kb/189484
Windows Script Control can be downloaded at http://www.microsoft.com/downloads/details.aspx?familyid=d7e31492-2595-49e6-8c02-1426fec693ac&displaylang=en. (Supported Operating Systems: Windows 2000; Windows 98 Second Edition; Windows ME; Windows NT; Windows Server 2003; Windows XP)
MSDN Search of "MSScriptControl.ScriptControlClass" at http://social.msdn.microsoft.com/Search/en-US?query=%22MSScriptControl.ScriptControlClass%22&ac=8
MSDN Search of "Windows Script Control" at http://social.msdn.microsoft.com/Search/en-US?query=%22Windows+Script+Control%22&ac=8
MSDN Search of "MSSCRIPT" at http://social.msdn.microsoft.com/Search/en-US?query=MSSCRIPT&ac=8
Unless you're doing it for your own instruction, you may want to try using Lua: VB6 - Lua Integration
If you're willing to use VBScript rather than VB6 you might be able to just use the MSScriptControl to run the commands rather than creating your own. Here's an article discussing using it from a .Net app, though it's an ActiveX control so should give you quite a bit of flexibility.
The control can be downloaded from here.
I've actually seen some quite reasonable implementations of compilers/interpreters in VB6[1] - It's not the language I would choose (few functional features, insufficent static type system), but with experience, you can outweigh these drawbacks and be quite productive - So why not.
You can use the GOLD parser generator that supports VB6 as a start.
[1]: Somewhere on PSC or in this download repository I think ...
Note that there is the MSScriptControl too.
There also appears to be an additonal alternative for VB6:
SadScript is an variant of VB6 most prominently used for VB6 as an scripting engine in MMORPGS .
See here for more : What is sadscript? Can I use it in vb.net? Why hasn't anyone I have asked heard of it?

Active X Development: VC++ or VB or Other technologies

We are in the process of creating active-x controls used within our application.
Since Microsoft stopped supporting classic Visual Basic, is it wise to use Visual Basic to develop the Active X control or the latest VC++/ATL/MFC libraries provide more feature where we can create controls faster by leaving Visual Basic flexibility?
We will not be able to use .NET/VB.NET/C# since the application is supposed to work inside containers and containers may not support latest .NET runtime.
Any other language is best fit for Active X control development other than VB and VC++?
I, personally, would recommend using Delphi for this. It is still actively developed, and has the control you get with C++, but a rapid development environment more like VB.NET.
#nobugz: If you are really interested what is ActiveX in Delphi, look at docwiki. Normally it is 100% source code (yours + VCL, VCL is also available as sources) with autogenerated COM wrappers. So all potential security problems are also in source code. If you find a security problem in VCL, please send a bug report to Quality Central.
Here is a good example on how to create ActiveX Controls with C# .NET
http://www.codeproject.com/KB/cs/CreateActiveXDotNet.aspx
By all means VB6 is the best language. After reading your question I feel that you are a VB6 developer. If you know VB6 and use it then why hesitate using it for producing ActiveX controls.
I program in Delphi as well as VB6 along with VB.NET and C# but creating ActiveX controls is the easiest in VB6 compares to all other development tools.
If you are hell bent on not using VB and if you are looking for an alternative then try out PowerBasic (commercial - very costly) or PureBasic (commercial but affordable) Get it from here or better still MinGW (a GNU C++ compiler).
I have to say that VB6 with a good book like Developing COM/ActiveX Components with VB6: A Guide to the Perplexed you will be up and running faster.

Free schedule/timetable GUI library for .NET

Does anyone know of any good free libraries providing Windows Forms controls for displaying schedules/timetables in .NET? I'm really looking for something similar to what the guy who asked this question was seeking, with a couple of differences:
I don't need any help organizing the underlying data or generating the schedule (that's all set) -- I just want a clean way of displaying it.
I'm actually looking for a custom control in Windows Forms, not an ASP.NET control.
One thing I've considered doing is just using a TableLayoutPanel control, but ideally I'm looking for something that will be more straightforward code-wise (as in, something actually designed for displaying a timetable) and sharper-looking visually.
How about this control? It is very similar to the calendar in Outlook. It does come with source code, so if it's not quite what you need you could maybe use this as a base for your own implementation.
Download the source code for http://www.monocalendar.com
He built a control (CalWidget) that you can easily recompile in your own project that's pretty nice. I recompiled it in .net 4.0 with little problems.

Accessing Windows Forms 2.0 combobox or AXComboBox

I have created a mutli-column combobox in VB.net 2008 using windows forms 2.0. I am having trouble accessing data once selected to use in the remainder of the form. There does not seem to be a selected event to use in conjunction with the winform 2.0 combobox.
Does anyone have any experience using winforms 2.0? Also I guess a better question would be: is there a site with a break down of windows forms 2.0? As so far nothing seems to be that detailed including MSDN.
There is a SelectIndexChanged Event for the ComboBox Class
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.aspx
SelectIndexChanged :
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selectedindexchanged.aspx
SelectedValueChanged:
http://msdn.microsoft.com/en-us/library/system.windows.forms.listcontrol.selectedvaluechanged.aspx
All Winform controls are documented pretty well on the msdn website.
The controls I am speaking of are in: axmicrosoft.vbe.interop.forms.axcombobox.
Which does not have much in the way of documentation. It does lend itself to creating multi-column comboboxes however.
I am not excited about the prospect of creating multi-column comboboxes, and I have explained and demonstrated to the customer that this is not the best implementation, but the customer still wants a multi-column combobox.
I am also open to the prospect of third party tools (free, and not free).
If anyone has any experience with this issue please forward any information they have.
We bought infragistics controls and that resolves this issue.

Watermarked Textbox for Compact Framework

Does anyone know if anyone makes a watermarked textbox control for the compact framework?
I already loked at the following and didn't see one.
Component One Mobile
Pocket PC Controls
Resco Mobile Forms Toolkit
Daniel Moth has a pretty good blog post about how to do this here:
TextBox with cue banner support for Windows Mobile
Best of all it is simple and free!
I've never seen one. This project shows how to do it yourself - not sure if it would work on CF, but I didn't see any obvious non-CF supported stuff in the example.