|
There is an ActiveForm property that returns the active form for the app, so you could do.
Form.ActiveForm.MyMethod();
and you activeScreen can be of type Form.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
I need to know how to detect the installed version of Microsoft Office (especially Outlook). Cause i have written a class to bypass the "Outlook Object Model Guard" and create addins for Outlook. But i need first to know which version of Outlook (XP or 2002) and which Office service pack are installed.
Does anyone have an idea ??
I think using registry is a good solution but is there any best way to do that ??
Thanks in advance.
Hawkmoon.
|
|
|
|
|
A few tips :
- More than one Office version may be installed
- Lookup HKLM\Software\Microsoft\Office\xxx\Excel\InstallRoot\Path="c:\....\Excel.exe". Where xxx is 10.0 (XP) , 9.0 (2000), 8.0 (97), ...
- this key tells you which Excel version is installed. It's up to you to check the provided path actually points or not to an existing Excel.exe file. To make sure that the retrieval works fine, combine this key with those from other Office apps, including Word, Powerpoint, Access, Outlook (due to a custom install).
- if you need to know which service-pack is installed, that's somewhat tougher. There are documented papers on the MS site for this purpose, but from my former code I can tell the fastest and easiest way to do so is to check the dll file version (xx.yy.[SSSS].zz) of the Office run-time (mso.dll on OfficeXP, mso9.dll on 2K, mso97.dll on 97, ...)
|
|
|
|
|
Thanks for all )
Hawkmoon
|
|
|
|
|
I want to display a window form inside another form
Please tell me how can i do that.
Thanks in advacne
|
|
|
|
|
I'm not quite sure what you mean faad.
If you are trying to display another windows form, you can use Form.Show().
If you are trying to run an external process you need to look at the System.Diagnostics.Process class and use the Process.Start() method.
Good luck
quorum pars magna fui
|
|
|
|
|
I have different forms in my application
there is a main form.
There is a splitter on the main form.
on left side when a button is clicked i want to display a form on the right side,and then change the right side form on each click.
|
|
|
|
|
Why not use the button click event to Show th componets?
quorum pars magna fui
|
|
|
|
|
Hi can you guys explain me is the
using System
using XXXXx
using blá blá
are the libraries where the prog is going to get some functions if so how can i get a detailed and easy understanding of each library, what can she do what is she for and so on.
Thanks 
|
|
|
|
|
view the microsoft documents that came with the .Net framework sdk... if you choose to install them...the would be under the start menu. the using referse to a namespace... in this case System (System.Console,ect)it also houses System.Windows.Forms (the form that windows applications are created from), and countless other functions.. i couldnt tell you all of them if i tryed lol. refer to the .net framework guide..for more info... if you didnt install it..you can reinstall or go to msdn.com and seach for the "using" command.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
thanks, i have then instaled.
|
|
|
|
|
I have a component that uses DesignerSerializationVisibility to serialize collection items to code.
It works great for adding new items to the collection, and rending them as well.
I cannot seem to get them to delete from the code when the parent is deleted.
Example:
I have a variation of the ToolBar, where the button collection is my own extension of the ToolBarButton.
When I add a button, it adds the code to the code file, creating and setting the values.
When I go into the button collection, and remove the buttons manually, the code goes away.
But if I just delete the tool bar, without deleting the buttons, the code for the buttons remains.
Things I have tried:
1) Adding the buttons to the components list.
2) Using the dispose method to dispose of the buttons.
3) Using the dispose method to manually delete the objects from the collection.
The tool bar class extends ToolBar, the button class extends ToolBarButton, and the collection extends CollectionBase.
I have also tried adding the buttons to the base class, but the code is still not removed.
The control seems to work fine, it just won't get rid of the code in the designer. The objects are even being disposed, as the next button I create starts at 1 again, and causes duplicate code entry (which is how I found the problem.)
Any help would be greatly appreciated.
Chris Rosenbury
|
|
|
|
|
I have a Webbrowser control in a window. When the user clicks a button I want to create a new window (Form) and move the webbrowser control into the new window. Sounds simple!
Trouble I'm having is that when I change the parent of the webbrowser to the new window, the webbrowser stops working. Its kind of frozen, no redrawing or anything. I think this has something to do with OCX, but I know nothing about OCX. When you add a webbrowser to your form in VS.net, it adds some code that deals with OCX.
Anyway does anyone know how to move a webbrowser control to a new window?
(I can't just make a new webbrowser in the new window because of the page that's in it..)
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
I believe you can't. Stuff like IOleClientSite, IOleInPlaceActiveObject are the reasons why.
|
|
|
|
|
OK. Dissapointing, but good to know. coming from you i believe it,
thanks,
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Need to search a C# string for a certain character, much
like strchar does for char arrays... what's the best way
to do this?
thanks
|
|
|
|
|
Strait out of the MSDN
String myString = "abc";
bool test1 = String.Compare(myString.Substring(2, 1), "c") == 0;
myString.Substring(3, 1);
bool test2 = String.Compare(myString.Substring(3, 0), String.Empty) == 0;
Or you could just use String.IndexOf()
Which would work something like
String myString = "abc";
int myInt = myString.IndexOf("c")
Where IndexOf() returns 0 - n if the char is found and '-1' if it isn't.
Hope this helps
But I, being poor, have only my dreams.
I have spread my dreams under your feet;
Tread softly, because you tread on my dreams.
- Yeats
|
|
|
|
|
hi,
I want to get notify before delete file occured in the file system
and to copy the file to other directory,doe's anyone know
how can i do this .
thank's 
|
|
|
|
|
nissiml,
Have a look at http://www.codeproject.com/csharp/fswatcher.asp[^] it will monitor a selected directory for changes. It may be eaiser to just proactivly back-up and monitor the files rather than try to intercept the file deletion.
Hope this helps
quorum pars magna fui
|
|
|
|
|
Hi guys
I am wkg on a C# Component which retrieves information from the ADS on Win2k Domain. For some reason, instead of using the System.DirectoryServices namespace, I have to go for the ADS Library (a COM DLL).
To write the code in VB.NET I can go ahead and use the GetObject Global method of VB. as following...
<br />
Dim objLDAP as ActiveDS.IAdsOpenDSObject<br />
objLDAP = GetObject("LDAP:")
' Here it uses the Global GetObject method,
' that specifies the First param as path and...
' NO ProgID as it is Optional Param.
In C#, I cannot use the same global function, hence the alternative, Activator.GetObject can be used. But it does not retrieve the reference at all.
I even tried, Specifically giving the Type param to the Method as...
<br />
IAdsOpenDSObject objLDAP;<br />
objLDAP = Activator.GetObject(typeof(ActiveDS.IAdsOpenDSObject), "LDAP:");
This ends up in giving error message saying that,
A Proper link to the Service may not have been established correctly. How can I make this work, as I must have all my Components in C# only. Porting this part in VB.NEt only for this reason would be infeasible.
Please help me out in this.
Atul Kale
Sr. Software Engineer.
XcelVision Technologies Ltd.
|
|
|
|
|
You really should be using System.DirectoryServices for this, and only resorting to the ADSI library as a last resort.
The Activator.GetObject is not related to the VB GetObject function. To replace the VB functionality, you can either use the Microsoft.VisualBasic.Interaction.GetObject function, or use a combination of the BindToMoniker and GetActiveObject functions from the System.Runtime.InteropServices.Marshal class.
using System;
using System.Runtime.InteropServices;
public class ComUtils
{
public static object GetObjectFromClass(string className)
{
object ret = Marshal.GetActiveObject(className);
if (null == ret)
{
Type t = Type.GetTypeFromProgID(className);
ret = Activator.CreateInstance(t);
}
return ret;
}
public static object GetObject(string pathName)
{
return Marshal.BindToMoniker(pathName);
}
public static object GetObject(string pathName, string className)
{
if (null == pathName || 0 == pathName.Length)
{
return GetObjectFromClass(className);
}
else if (null == className || 0 == className.Length)
{
return Marshal.BindToMoniker(pathName);
}
else
{
object ret = GetObjectFromClass(className);
UCOMIPersistFile pf = (UCOMIPersistFile)ret;
pf.Load(pathName, 0);
return pf;
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi Richard,
Thanx a lot for that code! In fact I had tried all the possible combinations of using Type.GetTypeFromProgID and then calling the Activator.GetObject etc. etc. But the most important thing I forgot was about the Binding part. I had been wkg on VC++ with Monikers many a times, I just never thought I would need them here too.
regards
Atul Kale
MCSD, MCT
Sr. Software Engineer
XcelVision Technologies Ltd.
|
|
|
|
|
does anyone know how to create disk quotas for users in c#, i am having a pain trying to figure this out.
please help!

|
|
|
|
|
Hi,
I'm new to this "Crystal Reports Stuff"... I would like to know a bit more about this...
Does it come to use it for free with VStudio .net ? ( at least for desktop applications ?).
How easy and powerful is this tool ? It's easy to integrate that into my applications ?
I'm thinking about start studying about this, or just export my reports into Ms Word, is that a good idea ?
thanks a lot, greetings
Braulio
|
|
|
|
|
I want to save My drawings on a form to a jpg of Gif files??!
I did it..but when I try to open them in a paintbrush or IE..I got some problems..on IE it didn't appear
and on paint brush it opens a black image??
please I need help in this as soon as possible
thanks
Muhammad Mahmoud Mousa Soliman
Faculty of Computers & Information Sciences
Information Systems Major
Ain Shams University in Cairo
|
|
|
|