|
I mean at ANY opacity.
I know that with the opacity = 0, the form behaves like it wouldn't exists.
Do you have any idea?
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
There is no direct way to do it. But there is a hack
using System.Runtime.InteropServices;
public class Form1 : System.Windows.Forms.Form
{
........implementation............
private bool FormMouseDown=false;
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (FormMouseDown==true) { return; }
FormMouseDown = true;
this.Visible = false;
SendDoubleClick();
Thread.Sleep(250);
this.Visible = true;
}
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
FormMouseDown=false;
}
[DllImport("user32.dll")]
private static extern void mouse_event(UInt32 dwFlags,UInt32 dx,UInt32 dy,UInt32 dwData,IntPtr dwExtraInfo);
private const UInt32 MouseEventLeftDown = 0x0002;
private const UInt32 MouseEventLeftUp = 0x0004;
public static void SendDoubleClick()
{
mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr());
}
}
|
|
|
|
|
Very interesting...
But I've got a question: during the Form1_MouseDown method, the form will hide for a while. I'd like to avoid this.
I've another idea:
if you can determine the window behind your window (I mean the IntPtr), you can use a method (SendMessage, SendInput) to send the click.
Any suggestion?
Thanks however for the help.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
|
but my form will be hidden during the procedure. this is not very good...
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
Give this a try it overrides CreateParams, there is code in c# and vb.
|
|
|
|
|
After a brief reading, I think that could be the solution.
Thank you very much
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
hi all,
must be simple but i could not figure it out.
how can i open a file providing a relative path? the file i want to open is in the root folder of the project together with the source files.
will really appreciate.
best wishes
rnv
|
|
|
|
|
Use Server.MapPath() to convert a virtual address to a physical address.
---
b { font-weight: normal; }
|
|
|
|
|
thanks.. but can it also be used with normal class file? my application is not webbased and just a simple class.
regards,
rnv
|
|
|
|
|
|
|
ooops
hi thanks a lot for the answer but i have another question.
when i compile my applciation it creates 'exe' file in 'bin/debug'. how do i specify that it should copy other necessary files as well?
regads,
rnv
|
|
|
|
|
too late....
I get it you are using VS.NET?
Personally I have VS2005 here and I can't be bothering launching VS2003, so here is how I do with 2005.
Project property => Build event
the you could type a few batch command in the appropriate box, like:
"copy C:\resourcedir\* $TargetPath"
I'm not sure this was available to C# project in VS2003....
|
|
|
|
|
|
I want to output data to the console from a button click on my WinForms application.
This is what I tried but with no call to the function aTest() was made.
Process myProcess = new Process();<br />
myProcess.StartInfo.FileName = "cmd";<br />
myProcess.StartInfo.Arguments = "aTest()";<br />
myProcess.StartInfo.UseShellExecute = true;<br />
myProcess.Start();<br />
Thanks
Kash
|
|
|
|
|
What you've done won't work. You've put together a command line that looks like this:
CMD aTest()
Try typing that into a Start/Run box. You'll find that it does the exact same thing as your code.
CMD doesn't know what to do with aTest() because it's not a valid command line argument for CMD . CMD cannot call back into your code to execute a method.
What I think you're trying to do is write to a console window that your application has complete control over. You can do this by redirecting the Streams of a CMD process. Check out this[^] article on MSDN, go about half way down the article, looking for Controlling Console Apps with the Process Class , and you'll see what I mean.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I've read some material and tried a few things but still no success.
If anyone has a snippet or small example; this would be very useful.
Kash
|
|
|
|
|
Hello,
I have a question regarding the inheritance of a sealed class. I would really want to know if it is possible inherit from FolderBrowserDialog. I want to extend the FolderBrowserDialog to do some checkings of the selected folder and to enable/disable the OK button. How can I do that in C#?
Larry
--
|
|
|
|
|
AFAIK it is not possible: the sealed attribute is made intentionally to avoid inheritance. I believe also the CommonDialog Win32 libraries are sealed.
[ITA] Tozzi ha ragione: Gaia si sta liberando di noi.
[ENG] Tozzi is right: Gaia is getting rid of us.
|
|
|
|
|
You cannot inherit from this class becuase this class is marked as sealed.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
I create FolderBrowseDialog and show it, but the treeview control [with directories] isn't visible
[code]
private System.Windows.Forms.FolderBrowserDialog oAddDir;
this.oAddDir = new System.Windows.Forms.FolderBrowserDialog();
public void OpenDir()
{
oAddDir.ShowDialog();
}
dialog is visible but without one control: - treeview
|
|
|
|
|
Did you set the COM threading model for your application to multithreaded apartment (MTA)?
[System.MTAThread]
static void Main()
{
I've learned the hard way that in this case the described error occurs in FolderBrowserDialog and you have to use the single-threaded apartment (System.STAThread).
www.troschuetz.de
|
|
|
|
|
I tried. but it is not working. The form which is use the folderBrowseDialog is a singleton form.
In other applications it works fine.
|
|
|
|
|
plz paste the code of serial port programming in c# here
thnx
|
|
|
|