In my C# (3.5) solution, i have 2 projects- a Class Library and WinForm project.
All business logic are in class library. while adding/updating data from WinForm, if Class Library finds any error, it will raise error and set focus to associate control in WinForm.
Is it possible?
Thanks,
SKPaul.
All UI logic should remain in your WinForm project. You will have to pass your control to class library to set focus from the library which is mostly a bad design. Instead:
The basic idea here is to signal an appropriate return value in case of an error. For instance a null value for an object, or a false for a bool value. You should check that in UI project, and handle it there. In your case setting focus hence should be from WinForm project.