|
Hi All,
A Windows Forms application (not asp.net)
I have 4 class library projects which contain classes and controls and forms which are naturally grouped together. 3 are c#, one is c++ with some unmanaged code in it.
My main application is a windows forms project with references to the other 4 applications in order to use their components.
I'm now trying to add a preferences system, using the .net 2.0 built in application settings stuff.
But, this leads me to a problem. If I define my settingsbase derived class in my main windows forms project, then the other projects know nothing about it, and i cannot give them a reference to the main project because it would cause a circular reference.
The only way around this i can see would be to implement yet another project with just the settings stuff in, because then all 5 current projects can reference it. But i'm not sure i want to do this. Is there another way??
Do other people run into these circular reference problems when trying to organise their code into multiple projects?
I guess i could join all the code into just two projects (a c# one and a c++ one), but that goes against the values of code reuse!
The other solution is to have each project implement and manage it's own settings, and save them from the main project - but surely this results in 4 separate settings files?
Thanks in advance for any ideas
Jon
|
|
|
|
|
Hi. I'm having trouble with setting the focus with WindowsForms. I'm trying to achieve the Windows OnScreenKeyBoard functionllity - achieving some action without getting the focus. I use the SendKeys.SendWait method to send keys to the window in focus, but in my case it is always the form containing the keyboard that is in focus
Can anyone give me a hint?
|
|
|
|
|
SendKeys class works only on the currently focused contorl. If you want to send keystrokes/Mouse clicks to a control, you have to get its handle and pass it to a SendMessage API function call. You'd send a WM_KeyDown message I believe. Here is a link[^] on how to make a PInvoke call to the function.
Ps.
Sometimes -though rarely-, you'd have to send another WM_KeyUp message after the WM_KeyDown message.
Regards
|
|
|
|
|
Hi guys,
I need something like dgwComboBox.SelectedIndex=0 but unfortunately datagridview doesn't has this property. What solution do you suggest?.
I need a default value for a DGWcombobox that was bounded to a datasource
Thanks!
drinking beer is fun
|
|
|
|
|
have you tried something like:
this.DataGridView1.Rows.Item(x).Selected = true ?
|
|
|
|
|
there's nothing like this in a datagridview
rows.items ?!
drinking beer is fun
|
|
|
|
|
|
You don't understand what I'm asking
I have a cell that is a datagridviewcomboboxcell and has 50 items, I want a default value to be displayed after I bound the datagridviewcomboboxcell to a datasource
drinking beer is fun
|
|
|
|
|
<big>Excuse me... have you found the answer for that DataGridViewComboBox index??? is just that I have the same problem</big>
IliCch
|
|
|
|
|
Hi,
Is there are more ways that we can add assembly or a dll to a project. One way that I know is by using Add Reference and selecting the required dll. Is there any other way? Anybody who knows please answer?
Thanks
Raja Raman S
Reuters India Pvt.Ltd.
Bangalore
|
|
|
|
|
I'm a little confused why that doesn't work for you?
|
|
|
|
|
Hi,
Thanks for all your effort in taking time to answer the question.
Sorry that I didn't make clear of my question. This way is working for me and it is fine. It is not giving any issues or any error while adding. I just want to know whether there is any alternate way that we can add an external assembly or dll to our project. I don't know any other method, if it is there, other than the above one. If anyone knows, please share. Hope this helps.
Raja Raman S
Reuters India Pvt.Ltd.
Bangalore
|
|
|
|
|
What exactly do you mean, I think I don't understand your question...
I always onclude all projects in the same solution an create references to project in stead of dll files. Is that what you mean?? Else, please explain your question a bit more...
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
The guys have all the right to be confused about what you want. Adding references that way is the default method of making a reference to a dll in your project. You should specify why you want an alternate.
Anyway, there is another way. You can always use System.Reflection namespace. There is a calss named Assembly , having a method named Load() .
Regards
|
|
|
|
|
Hi,
I just want to know whether any alternate is there for adding references other than the default way. The default way is working fine and no issues.
Thank you for the answer. So it can also be added through System.Reflection also.
Thanks once again.
Raja Raman S
Reuters India Pvt.Ltd.
Bangalore
|
|
|
|
|
Hi,
I am using the OpenFileDialog to locate a file called "data.csv", located on my Pocket PC. When I place the file in "My Documents\Taxes "I can locate this file and I have no problems. When I place the file in "My Documents\Taxes\Data" the OpenFileDialog can`t locate the file. It even can`t locate the "Data" subdirectory in "Taxes" directory. As I noticed the OpenFileDialog can`t browse deeper than one subdirectory of "My Documents". If anyone had this problem could you please tell me a solution.
|
|
|
|
|
Is this possibly a permissions issue? I asked because I just tried it, and I was able to access subfolders.
|
|
|
|
|
hello i want to create a directory from windows services my code is as below but is doesnt seems to do the work how can i do this.
protected override void OnStart(string[] args)
{
Thread mythread= new Thread(new ThreadStart(Run));
mythread.Start();
}
private void Run(){
System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:/mydir/mysubdir");
if(!dI.Exists)
{
dI.Create();
}
}
|
|
|
|
|
You wrote:
System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:/mydir/mysubdir");
I believe that should be
System.IO.DirectoryInfo dI= new DirectoryInfo(@"c:\mydir\mysubdir");
Use backslashes no slashes. Also I suggest you'd check the static methods of Directory class. No need to instantiate a DI object.
Regards
|
|
|
|
|
nice to see you back
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Thanks!
My exams are finally over. I now have a chance to breath again.
It's nice to be back, and meet you again.
Regards
|
|
|
|
|
I hope you did good
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
i was not mad when i was working with widows application but when i started working with "windows services" then things got crazy do you have any idea. abt windows services :->
|
|
|
|
|
i dont think its problem with back slash or a forward slash the same thing workd when i do with console application but it doesnot work with windows service. any idea its windows services not console application or windows application.
thanx though.
|
|
|
|
|
If(!System.IO.Directory.Exists("C:\\Something\\")
{
System.IO.Directory.CreateDirectory("C:\\Something\\");
}
|
|
|
|