|
I have a similar problem in the sense that i have a menu which i have created
Once i click a menu item i want to open another windows form.
suggest a way to do that plss!!
Sukanya
|
|
|
|
|
Try to create an EventHandler by doubleclick the menuItem.
private void miFile_Click(object sender, System.EventArgs e)
{
Form1 frm = new Form1();
frm.Show();
}
|
|
|
|
|
thnx a lot
Sukanya
|
|
|
|
|
Hi
Does anyone knows how to send a hot key to a Computer on the network?
I think I have to approach the keyboard. But how?
I've read something about keyboard Hooks.. But I don't know wether it's what I'm searching for..
Regards from Germany
|
|
|
|
|
You can't hook a remote keyboard. You can send commands to a remote service on that machine to send keyboard events (you don't want to hook them to send keyboard events, only to handle them - and you cannot handle Ctrl+Alt+Delete).
For managed apps you can use the SendKeys class, but it's rather limited. For cases that you can't solve with SendKeys P/Invoke SendInput and create what native structs and constants you need.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all, I am a c# programmer, have a problem nagging me... i was working with my vs.net fine till last day .. but all of a sudden when i try to open a new project in visual c#, i am getting a message "operation could not be completed".. i think im experiencing this only when i try opening new c# projects and project is creating for vd.net applications...i am trying to solve it out.. if anyone familiar with this could you help me out of this nightmare...
Regds
Robins
thomasrobins
|
|
|
|
|
Maybe you're lacking some necessary file system rights.
Once I've got a similar message whenever I tried to create a new code file. It even happens when I tried to create the file on my data partition where all users have write rights. It turned up that Visual Studio wanted to create the file on my c: partition first (my user had no write or change rights there) and then move it to the specified location.
To find out, if you maybe have a similar problem, you can use the freeware tool FileMon[^].
www.troschuetz.de
|
|
|
|
|
I figured it out, i was actually being really silly. Thought I would post here in case somebody else was having the same problem and looks in the archives.
Anyways, when you receive the object from the MSG it is not said in the XML what type of class it is. You need to specify this explicitly before you cast the object back to whatever type you want. ^^
Hope this helps some person in the days of yore,
Jim
|
|
|
|
|
Hallo,
I create objects of the same! class in two ways:
1) by .Net Remoting
2) in the usual way (without .Net Remoting)
I want to find out (in the class itself), if the object was created remotely by a foreign host?
Does anybody have an idea?
Thanks,
Björn
|
|
|
|
|
Will
if(obj is RealProxy) do the trick?
(Not tested, just a theory.)
|
|
|
|
|
I am using the lastAccess property of this class to compare two files to determine which one is the latest copy. It works on my computer just fine but once it is installed and run on another pc it always returns todays date and time is equal to 12:00 am. I have checked the two seperate files and there accessed date is definetely not what it is displaying. Anybody got any ideas or thoughts on this issue ??
|
|
|
|
|
LastAccessTime indicates when the file was last read, not when last written. You probably want LastWriteTime.
To stop the file system constantly writing the last access time, by default it updates once an hour. See Optimizing NTFS Performance[^] (from the XP Resource Kit) for more details. You can apply a registry setting[^] to disable the Last Access Time updates completely. It sounds as if this has been done on the PCs you're testing with.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi
how i can call a webmethod from outLook
i want to place a link on taksItem when clicked
download a file form webserver.
thanks
|
|
|
|
|
Im not quite sure if by webmethod you meant webservice, but if you did then you might be missing a reference. What you must do is add a web reference to your project and include it at the top of your file (by the keyword "using"). Then you simply call the method like you normally would.
What part exactly is hanging you up?
Jim
|
|
|
|
|
I dunno why I can't draw a curve as I want it.
Graphics g = new Graphics();
Pen p = new Pen(Color.Black,1);
PointF[] list = new PointF[2]{new Point(1,2),new Point(2,3),new Point(3,4)}
then.. g.DrawCurve(p,list,?,?);
What I should do ? do you can guide me to one good example ?
Why the start point always is (0,0), always the curve starts by the left high corner of my win application !!
Thanks..
.............................
|
|
|
|
|
ElJerry wrote:
PointF[] list = new PointF[2]{new Point(1,2),new Point(2,3),new Point(3,4)}
That statement is wrong. You have 3 elements, not 2. Don't declare an array size when you specify the array elements when you instantiate the array. The following is common and better:
PointF[] list = new PointF[]
{
new PointF(1f, 2f),
new PointF(2f, 3f),
new PointF(3f, 4f)
}; You're also using the wrong type. If you're declaring an array of PointF , the elements must be PointF . Frankly I'm surprised it even compiled. Declare and instantiate list correctly and you should see the results you want.
Have you read the documentation[^] for the Graphics.DrawCurve method? There's an overload that doesn't even require a 3rd or 4th parameter, and which can take either a Point[] or PointF[] . It's important to understand what the documentation says. There's also several examples for the method.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello there,
With this code:
<br />
...<br />
<br />
cmd = new SqlCommand( "insertData", conn );<br />
cmd.CommandType = CommandType.StoredProcedure;<br />
cmd.Parameters.Add( "@Name", strName );<br />
cmd.Parameters.Add( "@Data", stream.GetBuffer() );
<br />
int nResult = cmd.ExecuteNonQuery();<br />
<br />
return nResult;<br />
What will the value of nResult be if the insert operation is successful? It should be at greater '>' than 0 right?
This is weird because I'm getting a value that is not > 0, but as I checked the LastUpdate field in my database, the value is correct (which I assume it means that the data was inserted successfully). And yet, as I looked up MSDN, it should return a value of > 0.
What could be the problem?
Thanks,
~Rafferty
|
|
|
|
|
|
Hi
I have done a program , here The program reads any xml schema file and automatically writes 200 data's to a xml file(name as result.xml)according to their data types.
say for string-john1, john2,john3...etc..
say for decimal-101.20, 102.20, 103.20 ..etc.. so on.
And the program also reads a xml file with single field named address(for ex . so the program what it does is checks the schema file whether there is any element named "address" and it stores the fieldnumber(position of the field) and the field name in an array.
then the program reads a another input xml file(which has address values ). then it stores the values from the input xml file into the resultxml
I have done it and I am coming across some errors.I will paste the part of the program what I did.. Please help me to sort out the error.
private void button2_Click(object sender, System.EventArgs e)
{
ArrayList FiledNames = new ArrayList();
ArrayList MatchList = new ArrayList();
XmlTextReader xtr = new XmlTextReader(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml");
while (xtr.Read())
{
switch (xtr.NodeType)
{
case XmlNodeType.Element:
FiledNames.Add(xtr.Name);
break;
}
}
xtr.Close();
XmlDocument xdc = new XmlDocument();
xdc.Load(@"C:\CDEV\testdatagenerator\vw_forecast.xml");
dataSet1.ReadXmlSchema(txtSchema.Text);
foreach (DataTable dTbl in dataSet1.Tables)
{
int i = 0;
object[] oValues = new object[dTbl.Columns.Count];
xdc.Load(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml");
foreach (DataColumn dColmn in dTbl.Columns)
{
for (int y=0; y
|
|
|
|
|
At a quick glance I noticed that your first "for" loop is incorrect.....
What is the exception you're getting?
|
|
|
|
|
hi,
i found a form can't be destroyed after registered for the Main form's timer event. below are 2 methods used to create the form. one register with timer event, one without. i can see that the destructor of the one without timer event registered will be called after i open and close the form several times. but, the one with timer event registered. destructor will be called only when the main app exit.
so, any method to help?
<br />
private Form2 frmbulk;<br />
private int counter;<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
Cursor currentCursor = Cursor.Current;<br />
Cursor.Current = Cursors.WaitCursor;<br />
<br />
frmbulk = null;<br />
frmbulk = new Form2("Form2_"+System.Convert.ToString(counter++)); <br />
<br />
this.timer1.Tick += new EventHandler(frmbulk.TimerEventHandler);<br />
frmbulk.Show();<br />
<br />
Cursor.Current = currentCursor;<br />
}<br />
<br />
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
Cursor currentCursor = Cursor.Current;<br />
Cursor.Current = Cursors.WaitCursor;<br />
frmbulk = null; <br />
frmbulk = new Form2("Form2_"+System.Convert.ToString(counter++)); <br />
<br />
frmbulk.Show();<br />
Cursor.Current = currentCursor;<br />
}
|
|
|
|
|
Hi,
if object A (frmBulk) registers an event of object B (timer) it is like B would have a reference to A. Thus to free A you will have to unregister the event. So if you dont need the form any more:
<br />
this.timer1.Tick -= new EventHandler(frmbulk.TimerEventHandler);<br />
Btw: I dont think its good style to bind an event of object A (timer) to an object B (frmBulk) within a third object (main). I think it would be better if main just registers the event itsself and then just calls a method in frmBulk. To free bulk you would then only need to set the private field to null.
|
|
|
|
|
Well in my project in need of following menu extensions
a) make tooltips appear on mouse over the menu item
b) how can i organize the menu in multi columns - currently in one contex menu have about 100 items, whant to organize them on two panels, link "All Programs" menu in Windows
Regardless
|
|
|
|
|
You'll have to ownerdraw the menu and draw the menus yourself. There are no properties to support columns in the menus.
Tooltips, I don't know about. I don't think they're supported. I also don't remember seeing them in any application, at least, not in any normal application that doesn't ownerdraw everything.
But, something to think about -> If I opened a menu and saw a hundred items in it, I'd click Close, then Add/Remove Programs, Uninstall.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Set the BarBreak property of a MenuItem to true to start a new column in a context menu. For instance:
contextMenu1.MenuItems[2].BarBreak = true;
-----------------
| item1 | item3 |
| item2 | item4 |
-----------------
Charlie
if(!curlies){ return; }
|
|
|
|