|
Why ? He's already written it, he's saying it's too complex. This project does the exact same thing he has done, using the same COM interfaces.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
because he said "but there is still some problems "
i thought this code may help him
any way no problem
|
|
|
|
|
Thank you for your reply. I had seen it .It was written in c++,it also used COM code just as i did in c#, and this time I want to use a simple way to do it .
|
|
|
|
|
Please help me ,and this is really important to me.I will wait on line day and night.Many thanks!
|
|
|
|
|
look, several people have given you the answer. If you can live with it or not, is up to you. The answer won't change.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is another problem , I add the "Send To" menu items in the System's Send To folder , in win2000 ,all the "Send To" menu items are in this folder ,but in win_xp there are some items not in the system's Send To folder (such as floppy disk,DVD RW Drive),but they appears in system's send to menu. I just want to know does Windows puts “Removeable Drives” in the Send To menu automatically?
|
|
|
|
|
Obviously, it does.
While trying to fiddle around with the various places where SendTo entries can come from I guess it'd be faster to learn about the COM interfaces that should give you all SendTo targets, regardless of whether they are links in certain directories, registry entries or anything else.
mav
|
|
|
|
|
Which COM interface should I use to get all Send To targets?Please give me some useful information .Many Thanks!
|
|
|
|
|
how can i send data to a web page (PHP, ASP, JSP) using http get or post and the results of the post/get
|
|
|
|
|
.net framewrok have HttpWebResponse and HttpWebRequest
which will help you to do your task
in easy step
Create HttpWebRequest
set properties like method -Post,Get- ,contenttype
set proxy if you belong one
Create Stream and send Data
GetResponse
|
|
|
|
|
When I create a application with a empty form ,I use followed function to handle KeyDown event :
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyCode)
{
case (Keys.Left) :
MessageBox.Show("You have pressed Arrow-Key Left");
break;
case (Keys.Right) :
MessageBox.Show("You have pressed Arrow-Key Right");
break;
}
}
The application runs well but when I add a new button , this function can't handle the KeyDown event ,this code no longer runs properly.Why ?
I use Visual Studio .Net 2003.
Sorry if my English is not good.
This is all code :
-First is Empty form(Run well) :
namespace WindowsApplication2
{
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
this.Text = "Form1";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyCode)
{
case (Keys.Left) :
MessageBox.Show("You have pressed Arrow-Key Left");
break;
case (Keys.Right) :
MessageBox.Show("You have pressed Arrow-Key Right");
break;
}
}
}
}
- After add a button :
namespace WindowsApplication2
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(104, 80);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
this.ResumeLayout(false);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyCode)
{
case (Keys.Left) :
MessageBox.Show("You have pressed Arrow-Key Left");
break;
case (Keys.Right) :
MessageBox.Show("You have pressed Arrow-Key Right");
break;
}
}
}
}
le van giang
|
|
|
|
|
You need to set a property on the button so that the keyboard event it recieves when it has the focus is passed to it's parent.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
because when you add button control it has a focus when the form run
so the message goes to button not to the form
|
|
|
|
|
But when I set focus to Form :
Form1.Focus() ;
It still not runs.
le van giang
|
|
|
|
|
The property to set is on the Form, it's called KeyPreview. Set it to true.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry,It can't run.You can try it.
|
|
|
|
|
Fair enough. I'm sure that's what I did to solve it in my apps though. Is there a similar property on the buttons ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello Again,
I am back with another issue. Hope I will get help this time too...
I have a windows form where I display all my query results in a Data Grid. On double clicking on any record, the selected record is displayed in a new window(new form). I am able to achieve till this.
My problem starts from here. If I double click on the already selected record, the form should not be opened again as it is already open. But if I select different record from query results grid, another form should be opened.
What I mean to say is, I can have any number of forms open but only one instance should exist for any selected record.
Please guide me...
Thanks
|
|
|
|
|
A hashtable of the primary key value going to the modeless dialog you're obviously creating. If the key exists, the value is not null and the form the value points to is visible, don't display anything.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian. I am checking for the Key exists or not and restricting a new form from opening.
Thanks once again for all the help.
|
|
|
|
|
do not forget to remove the value from hashtable
when form closed
|
|
|
|
|
Sure I will do that. Thank You.
|
|
|
|
|
Hi,
Everytime I add the PayPalSvc web reference (ie:
http://www.paypal.com/wsdl/PayPalSvc.wsdl) into either a .Net console or forms app and try to compile I get this error:
The type or namespace 'PayPalAPIInterfaceService' could not be found - are you missing a using directive or an assembly reference?).
Can anyone tell me what I need to do to get this to work? THe web service adds in fine and I have a "using PayPalAPI.PayPalSvc;" in my C# code - what have I forgotten or done wrong here?
(And yes, I have also posted at the PayPal dev forums but almost no-one ever answers so was hoping some web services or C# guru could help me out here.)
TIA...
Mike
|
|
|
|
|
nzmike wrote:
The type or namespace 'PayPalAPIInterfaceService' could not be found - are you missing a using directive or an assembly reference?).
If you have the using directive, you must be missing the assembly reference. Have you linked your project to their assembly ? If it's a webservice, perhaps you need to import their service into the project ( get a web reference to it ) ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian but could you elaborate a little more? I've already added the web reference to the project (Project -> Add Web Reference) and it seems fine.... do I have do something else as well?
Mike
|
|
|
|