|
How about using a C# serial library?
A "naughty" way to do this for free in .NET 1.x would be to use reflector to copy the source of the classes.
Another possibility is that MS wrote a serial driver in VB.NET for their resource kit which they posted when 2003 was released. This provides the source code without having to go through reflector. The translation to C# shouldn't be that difficult.
Ed
|
|
|
|
|
Hi
I have a winform in vb.net and I want to print it (as is)...
I searched the internet for some code, all of which demonstrate using Graphics.DrawImage and BitBlt API to draw an image of the form to the printer . But as you know, there are lots of limitations.I must make my form fit on an A4 paper.
Could you please introduce me some references on printing a form, using standard .net method.
Thanks
|
|
|
|
|
Please dont crosspost, you clearly state this is a VB question so the post in that forum is sufficient
|
|
|
|
|
I don't beleive this is a VB question only, but rather a .Net question. Since any answer to this question in C# can be used in VB.NET and vice verca.
I also mean if someone could tell me how to print a form in C#, no difference!
This is the reason why I posted the topic in both forums...
|
|
|
|
|
when i override to handle tab in a textbox i have a ding sound like if the key is not supported/is not allowed in here.
<br />
protected override bool IsInputKey( Keys keyData )<br />
{<br />
if ( keyData == Keys.Tab )<br />
{<br />
return true;<br />
}<br />
<br />
return base.IsInputKey( keyData );<br />
}<br />
so how do i suppressed this sound ?
|
|
|
|
|
Override OnKeyDown instead and set e.Handled to true.
|
|
|
|
|
i need to override this to enable getting tab in my keydown override.
|
|
|
|
|
I think Robert is right... in the Keydown event, you may add
if(IsInputKey) e.Handled=True....<br />
This would stop the ding I guess....
|
|
|
|
|
I set the e.Handled=true but the annoying beep still coming
|
|
|
|
|
i did it. I had to set e.Handled to true in the keypress event. The keydown, keyup wasnt enough.
|
|
|
|
|
Hello!
I have one solution file that consist of three project.
One project that build a user control dll. In this user control we have a class called B
One project that build a class library dll. In this class library we have a class called C
In the user control project I have a project reference to the class library. I build the user control dll and this class library successfully.
This user control dll is added to the Toolbox. In the constructor for this class B is a call to instansiate a class C in the class library.
When I add this user control to the Toolbox I use directory obj/debug to select the user control dll. So adding the user control works fine.
When I drag this user control from the Toolbox into a form that exist in the project that build the exe file object B will be instansiated and another object which is class C will also be instansiated that exist in the class library. Like this.
public B()
{
InitializeComponent();
Last.C last = new Last.C();
last.foo();
}
In design mode when we want to design a form that exist in the project that build the exe file
we have one dependency the user control is dependent of the class library because an instance of class C will be instansiated as I mentioned before.
Now to my problem when I try to drag the user control from the toolbox into a form that exist in the project that build the exe file which search path is used to locate the class library dll because I get this error
"An exception occured while trying to create an instance of
WindowsControlLibrary.B. The execption was "?"." probably because the class library can't be found.
Where should I look and what should I do?
I'm rather new to using user control dll and class library.
One more additional information is when I drag the use control into a form a get the error message and at the same time two references are added which is the class library dll and the user control dll
If I look at the reference path for the class library that was added I
discover that my class library exist in this directory.
If I look at the reference path for the user control library that was added
I discover that my user control library exist in this directory. The two added reference path are the same.
//Tony
|
|
|
|
|
I am trying to create an ASP.net runtime from a cd rom. I am having a problem with 2 declarations.
private Server srv;
&
public Browser(Server srv)
For both "Server" parts it says : The type or namespace name 'Server' could not be found (are you missing a using directive or an assembly reference?)
I am using a tutorial to do this, but it does not mention anything about this. It just says
"add this private attribute to the class:
private Server srv; "
&
"The next task is to change the constructor of the Browser class by changing the constructor of the class like this:
public Browser(Server srv)"
Its a bit vauge I know, but any help would be appreciated. The full code snippet is below.
public class Browser : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
private AxSHDocVw.AxWebBrowser internetExplorer;
private Server srv;
public Browser(Server srv)
{
InitializeComponent();
this.srv = srv;
}
|
|
|
|
|
Hi all,
I have a form window which does not have a frame border and also i have set ShowInTaskbar to false.
I want my window to always stay on the desktop behind all the windows. What happens, as of now, is that whenever i press Show Desktop button, all windows are minimized. Since the window is not present in the taskbar, i cannot get it back.
Please help me out with this.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Why don't you press the button once again?
In that case all windows that where hidden would be displayed as they were...
And programatically, you cans send a WinLogo+D keyboard input....
Hope this helps..
|
|
|
|
|
Hey, thanks for the reply.
Well, thats not the main idea. I am not concerned about the rest of the windows. What i want is that my window should not be disturbed by Minimize all command. There must be some way in which i can make the window to stay at the back of all windows and stay up on the desktop.
Anyway, thanks for your help.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Hi
I am using a datalist to display images that are retrieved form a database in a gallery format (with numerous rows and columns). I have made the images selectable, but now I want to display the details of the image in a popup window when the image is selected. I need to display the selected image, the title, the category the image came from and the code of the image in popup window. How do I go about doing this? All the details, including the image iteself, are retrieved from a database.
Which event handler do I use? The onItemCommand or SelectedIndexChanged? How do I display the slected item and its details in a popup window? When the event occurs do I need to bind the data back to the control?
Thanks
|
|
|
|
|
My code is this:
System.Diagnostics.Process start = new System.Diagnostics.Process();<br />
start.StartInfo.FileName = pathToEXE;<br />
start.StartInfo.Arguments = someArguments;<br />
start.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;<br />
start.StartInfo.UseShellExecute = false;<br />
start.Start();<br />
start.WaitForExit();
However, when the application starts, I get the following message:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission,
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
How can I aasign security permissions to the started application? I should mention that when I start the application by itself, it works just fine - it doesn't need any rights.
What's the 'catch'?
Thanks
|
|
|
|
|
If the pathRoEXE is a UNC path then it will be run in the "Intranet Zone" which does not permit .NET applications to run by default.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Yes, it is a UNC path. But there must be a way to start a .NET application! How do I do that?
|
|
|
|
|
sandrina wrote: Yes, it is a UNC path. But there must be a way to start a .NET application! How do I do that?
Use Administrative Tools-->Microsoft .NET Framework x.x Configuration (where x.x is the version of the .NET framework your application is written in)
You then set the security on the exe, zone, UNC path or whatever as fits the security policy of your company.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
OK, thanx, that's big help. I'll try that.
|
|
|
|
|
Hello
I have a usercontrol(UC) with a number of childControls. My textbox control in the UC's got an EnabledSpecial event, which I wanna run when UC is enabled true / false.
protected override void OnEnabledChanged(System.EventArgs e)<br />
{<br />
if(this.Enabled)<br />
TextBox1.EnabledSpecial = true;<br />
else<br />
TextBox1.EnabledSpecial = false; <br />
}
It looks as if everything is run as intended, but the EnabledSpecial (which I do to make disabled text black instead of grey) doesn't take. Does anyone have an idea wherein the problem may lie?
-- modified at 4:53 Monday 3rd April, 2006
|
|
|
|
|
Looks good at first glance (I hope those extra brackets are only editing issues...).
Have you stepped throught it with the debugger and verified your property gets called? Probably it's just not working the way you expect it...
|
|
|
|
|
Thx for response, and yes, it was editing issues
The problem seems to occur when the Uc.Enabled is set to false... It seems the textbox gets normal .Enabled property set to false eventhough I try to override it.
|
|
|
|
|
protected override void OnEnabledChanged(System.EventArgs e)<br />
{<br />
if(this.Enabled)<br />
tbTextBox.EnabledSpecial = False;
else<br />
tbTextBox.EnabledSpecial = False;
}
|
|
|
|