|
Thank you very much. That worked
|
|
|
|
|
Here's my problem. I've added a Tree Control to my form. I've created my own child class of TreeNode (called TreeNodePtr), though, and I'm trying to use that. It's working fine, but everytime I change anything on the form in Design View, VS.NET changes all of the "new MyApp.TreeNodePtr(Test, "Test")" calls to things like (MyApp.TreeNodePtr)(System.Windows.Forms.TreeNode(Test, "Test").
I'm kind of new to this, but isn't this called a cast?
It's like the IDE knows I want to have a TreeNodePtr, but instead of just leaving it alone, it decides to cast it instead, and then it messes up all of my constructor calls.
|
|
|
|
|
Yes, it's a cast but there's really nothing you can do about it. The form and control designers do what they do. The only way to change it is to extend TreeView , create your own designer, and attribute your custom TreeView with the designer type you created. This isn't a trivial task, especially if you're new to .NET.
The other thing is to not use the designer! It's handy to initially layout controls on a form but it often becomes a hinderance. For example, I deal with a lot of localization but I hate how VS.NET does it. I rearrange quite a bit of code and move the ResourceManager out of InitializeComponents where VS.NET expects to find it. Since it doesn't, the designer breaks. I don't care though, because I stop using the designer long before that. It's the best way to truly learn what's going on instead of dragging-and-dropping your way to a simple application. Anyone can do that.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
i've created a web based setup project in VS.NET. Now everytime i start the setup.exe file, it downloads the msi package from the server. It would be nice if the setup.exe will check current installed version and only download if there is a new one on the server. Lets say a kind of update installation.
How to do that?
.:[Greetz from Jerry Maguire]:.
|
|
|
|
|
By buying a commercial Windows Installer development environment (like the user-friendly, yet completely customizable Wise for Windows Installer, or the very expensive InstallShield Developer) with a better bootstrapper (setup.exe), or by writing your own. See the Windows Installer SDK for information about that. It's not difficult, but it's important to remember that either you need to build your bootstrapper with each build, or have it download a configuration file (like the setup.ini file) that has the version information in it. The latter would definitely be easier than building and linking your own executable, but your bootstrapper will still need to know where to look (either by hardcoding a fixed URL for the setup.ini file or updating the .rsrc section of the executable with a more dynamic URL).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
I have a listview lv with lv.View = View.List. It always shows the items with horizontal scroll & not vertical !
Is there a way I can set it to scroll vertically when the no of items is more in the lv that its size ?
Paul
|
|
|
|
|
Not without extending ListView and owner-drawing several things about the list-view control (ListView is just a wrapper for the list-view common control). I'm not sure you could even do this if you did go to all that work (and it is a lot!).
If it's really necessary, you might be better off looking for a third-party .NET control that can do it. Be sure it's that important, though, since this would be inconsistent with practically all other list views in Windows. It's important to remain consistent for useability unless absolutely necessary (read the Windows UI Guidelines for more details and reasoning for this if you don't already see the inherent importance of it).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Here is my problem:
The user selects a file.
Based on what the extension is, I need to get the viewer that is registered with the operating system for this file type.
And then I need to open the file with the viewer.
Do you know how to do that in C#?
Thanks a ton,
Elena
|
|
|
|
|
Process.Start("path/to/file.ext"); For fine-grain control, see the ProcessStartInfo class where you can specify a different verb other than "open" (or the default, which is "open" on Win98/ME machines) or redirect the standard IO streams.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi guys,
I have a short (and simple, perhaps) question but I don't know where to start or where to search for more information. Is it possible to control graphic card driver / modify its settings from a windows forms application written in C#? I'm not looking for anything universal/reusable, all I need is to know if (and how) it is possible to control drivers for nVidia cards.
[Edit]
Additional info:
What I need to do is to control the nView settings (since this is a dual head nVidia graphic card). For example to switch the card between "clone mode" (where the image on both screns is identical) and "dual mode" (where both screens display separate image - the desktop is usually extended to cover both screens).
[/Edit]
Thanks for any clues or resource links,
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
I don't know what you mean by "control graphic card" , but managed DirectX may be what you look for.
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
Hi Daniel and thanks for a quick response.
Sorry for being so vague - what I need to do is to control the nView settings (since this is a dual head nVidia graphic card). For example to switch the card between "clone mode" (where the image on both screns is identical) and "dual mode" (where both screens display separate image - the desktop is usually extended to cover both screens). I'm not sure if this would be possible with DirectX
Thanks,
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
See the SystemInformation class. The VirtualScreen property gives you the entire Rectangle that spans all monitors in a multi-monitor system. You can then calculate where your windows are supposed to be. This still requires a multi-monitor system (either with a dual-head graphics card, or multiple graphics cards), but doesn't require that you have to support a specific driver (like NVIDIA).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello Heath and thanks for your response. I didn't know about the VirtualScreen property of the SystemInformation class, but I'm already using the Screen.AllScreens[i].Bounds to get the bounds of all monitors connected to the system and to properly position the windows.
What I'm trying to do is to switch the card into a mode when both screens display the same thing (clone) - I can do this manually using the display settings but I was looking for a way how to do this from a Windows Forms application (if possible at all). The reason for this is that I need to display the same content on both screens (one of them would be a projector) at certain times and instead of cloning the content programatically I thought that it would be more efficient to use the graphic driver capabilities to clone screen content.
Thanks again,
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Oh...I see, sorry.
This really warrants that you visit NVIDIA's web site and see if they have an SDK to download, or at least API documentation. This is nothing that is covered by C# or the .NET Framework (since C# is really just a language that targets the CLR, but anyway...).
You'll most likely end-up P/Invoking native calls to their drivers or some library that is installed as part of nView.
For more information on P/Invoke, see the System.Runtime.InteropServices.DllImportAttribute . This will allow you to call native methods from managed code.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
Radoslav Bielik wrote:
For example to switch the card between "clone mode" (where the image on both screns is identical) and "dual mode"
I don't know of a way to do it programatically, unless nVidia as an API available to do this. While DirectX can let you do some things with the card, it's not quite what you're looking for.
I had a similar situation when I upgraded my video card a few months ago. Unfortunately, I'm at work and the control panel is different, but I'll try to walk you through what may help.
Go to the Display control panel, click on the Settings tab and click the Advanced... button.
Click on the tab for nVidia (this is the part where I'm going from memory - I'm not sure exactly how it's labeled, but since you're asking this question, I assume you've poked around these settings already!)
On the navigation menu that sticks off the side (at least on the recent driver versions) one of the last options is Desktop Utilities. Click to Enable Desktop Utilities and then click the Desktop Manager Configuration button.
In the dialog box that pops up, one of the tabs is for Hotkeys. You can set one of these for various settings. I set up a hotkey to toggle Clone mode on and off.
I hope this helps. If I rambled on all this time and completely missed the point, please forgive me!;P
--Noah Duke
____________________________________________
// TODO: Insert incredibly witty sig here.
|
|
|
|
|
Noah Duke wrote:
I hope this helps. If I rambled on all this time and completely missed the point, please forgive me!
I am looking for a programmatic way but I highly appreciate your effort - the HotKey approach seems like a good idea. The problem is that now I have a localized Slovak version of the graphic card driver and can't find the settings I'm looking for at all! I hate localized software
thanks,
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Hi All,
Does anybody know a way to access the tag that is generated when the ImageUrl property of a System.Web.UI.WebControls.HyperLink is set?
I'm trying to write some onmouseover code to the image. If I could get the ID (which isn't written to the source of the page) I could call a javascript function passing it the Image ID.
I think it may have something to do with RenderChildren method.
If anyone has any suggestions, your help is greatly appreciated.
Thanks,
Mike Kushner
mike@kushners.com
|
|
|
|
|
Extend HyperLink and add your own properties and / or events to do this, and then override Render to output your properties as HTML attribute for the IMG tag that is generated. There are several methods you can use to apply the styles and what-not for the control. It's all documented in the SDK documentation for WebControl .
Either that (easier), or output a script block (see Page.RegisterClientScriptBlock or Page.RegisterStartupScript - and you can get the Page in which the control is contained by using the control's Page property) that uses the ID to dynamically attach an event handler, although you have to then take the ClientID (as dictated by how the control is nested in one or more INamingContainer implementations, like the Page or a Panel ). The first method would definitely be easier.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Are you stuck maintaining VB.Net code when you prefer to work in C#? Our C-Sharpener For VB tool is a Visual Studio Add-in that converts VB.Net projects to C# projects. It translates the code and other project related files.
We are looking for a limited number of Beta Testers to help test our new tool. If you are interested, please go to
http://www.elegancetech.com/CSVB_Download.aspx?src=1
Thanks!
Roger Jack
Elegance Technologies, Inc.
www.elegancetech.com
|
|
|
|
|
I'm not sure how possible this is. It probably is doable (creating some kind of rich-client-side control), just not very wise. Certainly there will be a lot of security implications with this (i.e. Client Browsers not permitting anything dodgy to happen). Best bet might be with an ActiveX control.
Out of curiosity - Why do you want to access the serial port on a client machine via an ASPX page?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I have a windows Form written in C#. I would like to "import" an Access MDB file into the project as a resource, then write this MDB file to dish at runtime. This was fairly simple in VC++ 6.0, but I'm finding little to no information about it in C#, any suggestions ?
Michael Malling
|
|
|
|
|
Whats the part you having difficulty with?
|
|
|
|
|
I've saved the MDB as an Resource template (RCT) file now i need to write it to disk...
|
|
|
|