|
That's crap. Oh well. Thanks for the response.
Jon Sagara
If you've ever watched 6-year-olds playing soccer, that's what the mainstream media is like.
-- Jon Stewart
My Articles
|
|
|
|
|
C'mon! What fun would the world be if it was mearly handed to you?!
Write the damn thing!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How does one find out the items that are checked in a CheckedListBox??
I tried the following but i get weird output.
private void checkedListBox_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)<br />
{<br />
CheckedListBox box = (CheckedListBox)sender;<br />
int numItems = box.Items.Count; <br />
this.debugArea("\r\n");<br />
for (int i=0; i < numItems; i++)<br />
{<br />
String name = box.Items[i].ToString();<br />
if (box.GetItemCheckState(i).Equals(CheckState.Checked))<br />
{<br />
checkValues[i] = true;<br />
this.debugArea(name+" True:"+i+"\r\n");<br />
}<br />
else if (box.GetItemCheckState(i).Equals(CheckState.Unchecked))<br />
{<br />
checkValues[i]=false;<br />
this.debugArea(name+" False:"+i+"\r\n");<br />
}<br />
else if (box.GetItemCheckState(i).Equals(CheckState.Indeterminate))<br />
{<br />
checkValues[i]=false;<br />
this.debugArea(name+" NA:"+i+"\r\n"); <br />
}<br />
} <br />
}
When the first value is checked I get -
Changed False
Created False:1
Deleted False:2
Renamed False:3
When I uncheck that same first value -
Changed True
Created False:1
Deleted False:2
Renamed False:3
what gives here -
|
|
|
|
|
Just enumerate the CheckedListBox.CheckedItems property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can we create array of delegates ? and then use them in our program.
Regards,
Asim
|
|
|
|
|
Why do you need it? There are multicast delegates in .NET.
Perhaps there is another solution to your problem if you describe it in more detail.
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Yes you can, but as Serge mentioned, there are MulticastDelegate s, which are used for events handlers. This allows you to combine delegates via Delegate.Combine . In .NET, actually, all delegates are treated as MulticastDelegate s. I remember reading an article about its inclusion a few years ago.
If you want to just use a simple array, though, it's as simple as any other type:
delegate[] dels = new delegate[2];
dels[0] = new EventHandler(btn_Click);
dels[1] = new CancelEventHandler(form_Closing); Using Delegate.Combine is much better, though, especially since it allows you to invoke the entire list of delegates unlike this array for which you'd have to iterate and invoke each delegate yourself.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have problem in my application.
When ever I declare
using System.Net;
using System.Windows.Forms;
I am getting an error message like Net class not found or it is not name space or class
I am also getting similar error for the Windows.Forms
also.
Please let me how to solve this problem.
Thanks in Advance.
bbye
Practical Reality.
|
|
|
|
|
Sounds like you forgot to add references to the corresponding class libraries.
Go to the solution explorer, right-click on References, select "Add reference" and under the tab-page ".NET" double-click on the desired class libraries.
www.troschuetz.de
|
|
|
|
|
Hi,
I want to add a background image to treeView. I tried to override the background image or to use transparent color(the treeView is on a panel, so I put the image on the panel) but for that, I needed to set the ControlStyle to ControlStyle.UserPaint.
When I do that, I can see the background inage, but I can't see all the nodes in the tree..
Can anyone help?
Thanks
|
|
|
|
|
The reason the property was hidden is because it is not supported. The TreeView class, you see, encapsulates the Tree-View common contorl. Most of the controls in Windows Forms encapsulate Windows common controls. They handle messages and send messages as you would in VC++, MFC, etc.
The Tree-View common control does not support background images. If you want such support, you should take a look at a much better tree anyway, like UltraWinTree from Infragistics[^]. It supports drag and drop, multi-select, background images, multiple tree node images, Visual Styles, and has a great UI toolkit. It's a royalty-free control that is pretty cheap. You'll spend a hell of a lot more money in man-hours trying to reproduce even just a couple features that you're given in UltraWinTree.
There's also others, like XtraTree (something like that) from Developer Express[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm trying to transfer an argument to a webmethod of type System.Version. The method is declared like
public string Something(System.Version version, string strText) {...}
but when a client (C# program) calls the method, I get the following type information for the parameters:
string MyWebservice.Something(some.strange.namespace.Version version, string strText)
- where I would expect
string MyWebservice.Something(System.Version version, string strText)
So I can't transfer a System.Version as first argument. What am I doing wrong ? Can't such types be transferred to a webservice ? Have I forgot to scope something with the correct namespace ?
The SOAP packet description that displays when accessing the .asmx file says something like
<something xmlns="the.namespace.here">
<strtext>string
<version>
Where I would expect
<something xmlns="the.namespace.here">
<strtext>string
<version>System.Version
Any help would be greatly appreciated.
Best regards
Jan Hansen
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
There's nothing wrong with that namespace - it your project's root namespace plus the namespace you configured for the Web Reference when you added it, plus the class name (Version ).
No, not just any type can be used in an XML Web Service, not without some extra support. Remember that XML Web Services are not .NET-specific, and other platforms won't have a System.Version, mscorlib type, though they will have the primatives that .NET has as well.
So you either have to declare it as a string and document what that parameter should contain (typically the best way), or declare a simple struct that can be reflected in WSDL. This ensures that other platforms can use your version struct (or class, if you'd like, but a struct would probably be better, also seeing as Version itself is a struct).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks a lot !
If I remember it correctly, I Can't just declare a standard struct and use an argument of that type - I need to do something special to get that struct "out" of the webservice. Do I have to mark it like a method is marked [WebMethod] ?
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
Nope, just declare the struct as public and your parameter declared as that type.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm working on a C# dll that passes data back to an older vb6 application. Passing the standard data types are no problem, however, passing a collection of objects (SortedList) have been troublesome.
Has anyone tried this before? And if so how did you do it? Looking for any reference material or sample code.
Thank You,
ddcs
|
|
|
|
|
Hi,
How do I get the installation path that the user selects while installing ?
If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime).
Thankx in advance
Priya
|
|
|
|
|
what kind of set up tool that you are using.
Rock Throught The Night
|
|
|
|
|
I'm using VS.NET setup & deployment project
|
|
|
|
|
Hi, Priya
You will need to add a custom action to your setup project. Pass the [TARGETDIR] variable to your custom action:
CustomActionData = /instdir=[TARGETDIR]\\
(the last "\\" is neccessary for correct passing of paths)
Get the "instdir" parameter in the custom installer class's Install method in the custom action project:
[code]
Dim instdir As String = Me.Context.Parameters("instdir")
[/code]
That's it
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
You can interop with the msi.dll COM server to get access to the database and package methods, or you can P/Invoke the exported C-style functions from the same DLL.
You can query the component's installation directory at any time using MsiGetComponentPath , where you pass the ProductCode, the ComponentId, and a path buffer plus it's maximum declared size. See the Windows Installer SDK in MSDN[^] for more details.
There's a catch, though: VS.NET's Windows Installer project sucks. It will generate new ComponentIds each time you recompile and doesn't let you specify a feature/component layout. I'd recommend getting a decent Windows Installer development environment like Wise for Windows Installer[^].
Finally, whether or not that file changes often Windows Installer is designed to allow for such changes and you should not copy the file manually. Windows Installer is an installation package manager - not just a simple install runtime. Just add the changed file to your setup project and make sure that the project's property "RemovePreviousVersions" is set to True and that the "UpgradeCode" never changes. Also change the "Version" according to how much changed (it's really up to you).
If you'd like, you can generate a patch (.msp file) that is the difference between two installation packages. Again, though, because of the Windows Installer's short-comings this would be difficult and would require manual, post-build steps.
This is the correct way to distribute updates to your product.
If you're interested in Windows Installer, see Widnows Installer[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Dear sir !
+. How can I initialize tapiFax
+. Tapi3.x which is support send/recevice Fax ?
+. Please help me
|
|
|
|
|
How can check event when value changed True or False.?
Thank!
|
|
|
|
|
More than likely there is a much easier way, but you can always write your own class and inherit it from the DataGridBoolColumn class and you'll be able to handle the checkbox events in that class. As long as you don't change anything else, all other functionality will remain the same. Hope this helps.
|
|
|
|
|
The problem is that the DataGridBoolColumn does not use a CheckBox - it's actually drawn using the appropriate state using ControlPaint.DrawCheckBox .
Microsoft MVP, Visual C#
My Articles
|
|
|
|