|
|
I designed 2 form. One is MDI form(i named frmMain) and another is child form (i named frmLoggon).
On frmMain form i got a menuItem (i named menuItem1)
On frmMain Form
private void frmMain_Load(object sender, System.EventArgs e)
{
frmLoggon fLoggon = new frmLoggon();
fLoggon.ShowInTaskbar = false;
fLoggon.ShowDialog(this);
}
On frmLoggon Form i got a button (i named btExit)
private void btExit_Click(object sender, System.EventArgs e)
{
frmMain fMain = new frmMain();
fMain.Menu.MenuItem[0].Enabled = false;
this.close();
}
but the menuItem1 not disabed.
Please help me as posible as you can.
Thanks
Mr Duc Linh Nguyen
|
|
|
|
|
frmMain fMain = new frmMain();
fMain.Menu.MenuItem[0].Enabled = false;
You are just disabling the menuitem which resides on temporary MDI instantiated form. It exists only in btExit_Click procedure scope. So you need some permanent refrence to your MDI form. I'd recommend passing the MDI reference as a parameter to your child form's constructor like this:
private void frmMain_Load(object sender, System.EventArgs e)
{
frmLoggon fLoggon = new frmLoggon(<font color='blue'>this</font>);
fLoggon.ShowInTaskbar = false;
fLoggon.ShowDialog(this);
}
In your frmLoggon constructor:
frmMain _parent;
public frmLoggon(frmMain parent)
{
<font color='green'>
_parent = parent;
}
and finally:
private void btExit_Click(object sender, System.EventArgs e)
{
_parent.Menu.MenuItem[0].Enabled = false;
this.close();
}
I hope this helps.
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Hi, I don't know that, what i am goin to tell u is good wayout but I am sure this will work.
Ur menuItem is not disable bcoz u r make another instance of the main form n then on that u r making it disabled so u need to disable it with first instance. do one thing take a global integer set it as 0 then check on frmMain_Enter() event. if it is still 0 then don't run
Menu.MenuItem[0].Enabled = false;
set interger to 0 so that u can chk it correctly again.
other run this.
Now exiting from frmLoggon thats btExit_Click event set this interger to 1.
simple. I hope u understand what I written. Good Bye
Inpreet Singh
|
|
|
|
|
I want to set and get mouse positions in C#.I also want to get keyboard events.please help me.
mughalali
|
|
|
|
|
I guess you can access to mouse position by using Cursor object.Some thing like this:
Cursor.Position.X
Cursor.Position.Y
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Are you talking about getting the keyboard and mouse positions in your app, or system wide no matter what app actually has the focus?
RageInTheMachine9532
|
|
|
|
|
I want to get keyboard and mouse control in my app.Please tell me how i get or set keyboard events in my app.
Actually iam doing final year project on remote desktop control. so i need to control keyboard and mouse of remote system.
mughalali
|
|
|
|
|
mughalali wrote:
I want to set and get mouse positions in C#.
Control.MousePosition is another way.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
I want to get keyboard and mouse control in my app.Please tell me how i get or set keyboard events in my app.
Actually iam doing final year project on remote desktop control. so i need to control keyboard and mouse of remote system.
mughalali
|
|
|
|
|
hello there,
i wonder if anyone has this dll system.storage.schemas.dll , or know link to download it as i need namespace in System.Storage.Explorer
|
|
|
|
|
This namespace and the dll are part of .NET Framework in Windows Codename Longhorn and you cannot get it for other operating systems.
|
|
|
|
|
i want to use the namespace in a program and when i searched for it...i knew that it i in this dll but when i searched for dll over my pc i couldnt find it so tell me what to do to use namespaces in
|
|
|
|
|
What do you want to use the namespace for? It will only work on Longhorn and the WinFS file system...
In order to get the .dll, you need to download the Longhorn SDK from Microsoft's MSDN Subscriber Downloads. You can only do that if your an MSDN Subscriber...
Oh! A minor problem --> You can't install the Longhorn SDK on a machine that has the .NET Framework SDK installed. This means you can't install the SDK on the same machine as any version of Visual Studio.NET.
RageInTheMachine9532
|
|
|
|
|
hi dave,
i want this namespace to get internet explorer history, i know how to get instances runnig from ie but only the window title of ie but not full url as i am using only c# ..i ve code for it in c++..but i dont know how to convert or use functions in it so tell me if u ve solution
|
|
|
|
|
Uhhh...you're not getting it...
THAT.DLL WILL ONLY WORK WITH WINDOWS LONGHORN AND WINFS! THERE IS NO WAY TO GET IT TO WORK WITH ANY OTHER VERSION OF WINDOWS!
On top of that, it has nothing to do with IE, let alone it's history files...
RageInTheMachine9532
|
|
|
|
|
i got code now but i didnt try it...here u r a copy form it
namespace CSharpcenter{
using System;
using Microsoft.Win32;
public class ConsoleApp
{
public static int Main(string[] args)
{
//
// TODO: Add code to start application here
//
//get down to the Typed URL in
//HKCU\\SOFTWARE\\MICROSOFT\\INTERNET EXPLORER\\TYPEDURLS
RegistryKey theCurrentMachine = Registry .CurrentUser ;
RegistryKey theSoftware = theCurrentMachine.OpenSubKey ("SOFTWARE");
RegistryKey theMicrosoft = theSoftware.OpenSubKey ("Microsoft");
RegistryKey theIE = theMicrosoft.OpenSubKey ("Internet Explorer");
RegistryKey theTypedURLS = theIE.OpenSubKey ("TypedURLs");
//Now get all the values in the key...
long lCount = theTypedURLS.ValueCount;
if(lCount <= 0) return 1;
string [] arTypedURL = theTypedURLS.GetValueNames();
Console.WriteLine ("You have typed in following web sites in IE :");
int i = 1;
foreach ( string theURL in arTypedURL)
{
//get the name of the url ...
Console.WriteLine ("[{0}] {1}",i,theTypedURLS.GetValue (theURL));
i++;
}
return 0;
}
}
}
|
|
|
|
|
OK. That's code to get the list of URL's typed into the address bar. It's not the history of URL's that IE has gone to...
All the history URL's are stored ina single file called "index.dat" in the path:
C:\Documents and Settings\<loggedInUserID>\Local Settings\History\History.IE5 for Internet Explorer 5. For version 6 it will end with "\History.IE6"...
There is no API will will let you get at the entires in the index.dat file. You will have to write your own code to open and parse up the file. Some investigating has revealed some site that have dug into the format of the file. Try this[^]...
RageInTheMachine9532
|
|
|
|
|
Hello,
I'm converting some VBS scripts to C# and one of them uses the following lines of code
Set MyDCOM = CreateObject("NODMON.NODCLS")
retval = MyDCOM.addmsg("", "", 1, Now, 0, 3000, Message)
Could someone point me in the right direction for how I should go about converting this? It's mainly the CreateObject statement I'm unsure of!.
Thanks
|
|
|
|
|
Gareth_Hastings wrote:
Set MyDCOM = CreateObject("NODMON.NODCLS")
retval = MyDCOM.addmsg("", "", 1, Now, 0, 3000, Message)
What you are doing here is late binding in VB. While C# does support late-bound object creation (i.e.; look at Activator.CreateInstance ), there are several ways to access what you are doing. One is to generate the appropriate interop assemblies (for example if you are using Visual Studio .NET you can simply use the Add Reference -> COM tab), this will allow you to declare the object and take advantage of early-binding at compile-time or you could use reflection to generate the object at run-time (the Activator class).
- Nick Parker My Blog | My Articles
|
|
|
|
|
>plz,
help me to get active (running)network neighbors in a LAN
and thier IPs.
BELALSOFT
|
|
|
|
|
Maybe this code example can help you. I use it to determine if a specific ip-address is reachable. If not the exeception is thrown.
try
{
System.Net.Dns.GetHostByAddress(ipAddress);
}
catch (System.Net.Sockets.SocketException)
{}
If you build a loop to test all possible lan addresses, you should get the running neighbours. The ipAddress can be specified either as string or as an object of IPAddress class. To get the name of an host according to an running IP address, use the IPHostEntry object returned be the GetHostByAddress method.
This way may be a bit ineffective, but at least it's better than nothing
|
|
|
|
|
I'm trying to get an MDI window that contains a number of sub forms, one of which i would like to be an MDI.
I am looking for an effect similar to the one found in the relationships window of access. Where the Access window is the parent of the relationship window which in turn is the parent of a number of "table view" windows.
However, when i try and enable MDI container on a contained form... it crashes, as it says a MDIContainer cannot be both a child and a parent form.
As another note, the relationship window, while contained in the main Access view, also displays a window icon on the task bar below the table view. I'm not sure how this is implemented.
Are the "table view" windows actualy forms? Or simply objects that seem to behave like forms, but lack a lot of the functionality? In which case, how do i construct a form that handles them like child components, and is a child form itself?
I noticed that the access relationship window does not have the automatic scroll bars that MDI containers use, they are pre-placed, so it's a fixed size canvas and it does not implement MDI because the background colour is not MDI container. So how do the sub objects work?
Are they components? Or panels? Or some other object? I'm trying to figure out how to apply an adjustable border (re-size and move) to a selectable form component. Bit confused.
Cheers
Cata
|
|
|
|
|
The Catalyst wrote:
I'm trying to get an MDI window that contains a number of sub forms, one of which i would like to be an MDI.
Can't do that. An MDI Parent cannot be a child to another MDI Parent.
Access uses what looks like child windows in it's relationships window, but they are really controls that have the appearance and some behaviors of a real window.
RageInTheMachine9532
|
|
|
|
|
I figured that out. The relationship uses other features that a pure MDI window would not allow.
Do you know how to implement these controls? I played with custom controls, but there is no way to set the border on them, so i'm lost.
If i could build the object, i could manage them with an array easy enough, but i really need to find out how to implement the movable and resizable form style border.
Cata
|
|
|
|