|
there is a little mistake in your select statement.
try this:
this.dgGDS.Select(hti.Row);
but then more and more rows will be selected because there is no unselect of the old row
|
|
|
|
|
Hi,
I found an article here on Cp on how to use the push method of Crystal reports.
The only difference is however, that I create my datasets manually, therefore I think you need to define the fields in your report manually too. (correct?)
How can you do that? All the members are always 'read only', so my compiler claims.
tnx!
No hurries, no worries.
|
|
|
|
|
Hi all, please can anybody tell me how can I use a DLL created via C++ in C#.NET? I tried using the Add reference but it didnt' work. It gave me a message that it's not a valid assembly or com component.
SoCRaT
|
|
|
|
|
.NET can automatically handle COM objects, it generates RCW (Runtime Callable Wrappers) around them by itself.. For non-COM dlls, you'd have to use Pinvoke[^]. It's fairly easy. For eg, to access method Foo in X.dll, the following code will do..
class SomeClass
{
[DllImport("X.dll")]
private static extern void Foo();
public void SomeMethod() { Foo(); }
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
you can use the methods of a dll in c# in the following way:
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, string lParam);
|
|
|
|
|
How much data can a dataset contain, i mean the size of dataset.
Thanks
|
|
|
|
|
Do you mean how many tables, or how many rows ? What size do you have in mind ? Did you consider just creating one and seeing if it goes big enough for you ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I am finding it difficult to add a value to pretty much any registry key on a Windows XP machine. The folowing code allows me to add the new key and or open the key as read/write but will not all the value to be created and set. Even if I manually add the value the code will still not adjust what the value is set to. I have tested this on 8 different Win XP machines ranging from no service packs to the most receint. I have tried running the program including this test code under administrator and user account levels in XP with no luck. Can someone please tell me why this code does not do what it is supposed to. I thank you in advance for your assistance.
private static void NoCMD()
{
keyValueInt="2";
subKey = "Software\\Policies\\Microsoft\\Windows\\System";
try
{
key = Registry.CurrentUser;
key.CreateSubKey(subKey);
key.OpenSubKey(subKey,true);
key.SetValue("DisableCMD",keyValueInt);
key.Close();
Console.WriteLine("Edit Complete: Current_User\\" + subKey + "\n");
}
catch(Exception ex)
{
Console.WriteLine("Edit: Current_User\\" + subKey + "\n" +
"ERROR: " + ex.ToString());
}
}
|
|
|
|
|
I just do this:
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Graus", true).SetValue("PathLastOpened", value.ToString());
I like to hide them behind properties
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thank you very much for the quick reply and your assistance. I will give that a try and see if it works for what I am trying to accomplish and report back... Thanks again...
|
|
|
|
|
Well my friend, it worked perfectly, why chaining the arguments together instead of seperately would make such a difference we shall never know but heck, it works and that is amazing in and of itself. Thank you for your assistance. I rated your reply as a 5.0 perfect.
|
|
|
|
|
Glad to help
I have no idea why your old code shouldn't work, I just grabbed some of mine that does.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian's code uses the value returned by the CreateSubKey, OpenSubKey etc.. functions to do the next operation. Your code calls all those methods on just the key object. Maybe that's what is wrong, maybe you should be writing code like
retKey = key.CreateSubKey(subKey);
retKey = retKey.OpenSubKey(subKey, true);
...
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I actually tried that exact method with no luck, don't know why. Thanks for the idea though...
|
|
|
|
|
Hello everyone,
I want to implement a Font Bar(not FontDialog) like this,
______
B I U S
-------
Is there any ready-made control class in .net FCL? If not, how to realize it?
welspring
hope for help
|
|
|
|
|
There is no such ready-made control class in .NET base classes. However, you can use a toolbar in your project alongwith an ImageList control(in which I suppose that you might be implementing the RichTextBox control for showing bold, italics characters, etc.). After adding the imageList and toolbar, add different images in the Images property of the ImageList in its properties window in the designer. As a part of these images, you can supply your own images for "Bold", "Italics", etc. Now, select the toolbar in designer and go to its property window. Select the "ImageList" property of the toolbar and assign the value of the instance of the ImageList control added to your project. Now go to 'Buttons' property of toolbar and click on the Collection "..." button to add your buttons. While adding buttons, select the appropriate ImageIndex (which will link a particular image from the aforesaid ImageList to a particular button). Now you can add an event-handler for the "ButtonClick" event of the toolbar wherein you can provide code for linking these buttons with the formatting of the RichTextBox, such as italics, etc.
|
|
|
|
|
Why is the windows datagrid SO uncooperative (not my real question, I just couldn't resist). I need to create a datagrid column containing a pair of radiobuttons per cell. I can find plenty of examples that create a column that shows ONE control that shows up only when the cell is selected, but I want mine to show all the time (two radiobuttons visible in EACH row in the column).
If anyone could give me a clue about this I would really appreciate it.
thanks!
Deanna
|
|
|
|
|
Hi Deanna,
For displaying 2 radio buttons you can create a custom user control that has 2 radio buttons and use it in the data grid.
DataGridTextBoxColumn column1 =(DataGridTextBoxColumn)dataGrid1.TableStyles[0].GridColumnStyles[0];
column1.TextBox.Controls.Add(new WindowsControlLibrary1.UserControl1());
Thanks and Regards
SGS
|
|
|
|
|
I could, but normally doesn't that code go in the 'Edit' method of the column and only display the control when someone clicks the cell? I want them to display all the time.
If there's somewhere else I can put the code for my desired effect, please let me know.
thanks,
Deanna
|
|
|
|
|
Is there a way to define maximum length of value for specific column directly in DataSet (*.xsd file)? I would use this for setting value of MaxLength property of TextBox for example...
Any ideas?
|
|
|
|
|
I've been working hard trying to get a remoted version of the Windows MediaPlayer to work with C#. I've seen some references to other projects that have succeeded in part:
http://blogs.msdn.com/ericgu/archive/2004/09/01/224147.aspx
I've tried using the project referenced there, and it sort of almost works. I get strange assertion errors at startup and at shutdown. Also, if I then deploy my application along with the remote player libraries onto another machine, it won't run at all. I have to actually install VS C++ *and* build on the target machine for it to work. It seems as if this project is set up more for WMP 9 than 10.
The assertion I've seen at startup says:
ATLASSERT(!InlineIsEqualGUID(*m_plibid,GUID_NULL) && "Did you forget to pass the LIBID to CComModule::Init?");
I've seen the following reference to this general problem, which has to do with ATL incompatibilities:
http://userpages.umbc.edu/~bcorfm1/wtl.html
So, although I can modify the VS C++ project to link dynamically to the ATL library, I still have the problem that I can't deploy my application on other machines (it just crashes, and complains about the wmppia.dll file and/or throws the same assertions). Even after changing the ATL linking, I get an assertion when I close my application. It says "Debug Assertion Failed! File: wincore.cpp, Line: 1002."
I'm definitely a C++ novice, so I don't really know how to create a true interop solution for my C# project, so that I can have the full remoted Windows MediaPlayer object. We actually want to use it in docked mode constantly, so that the full Windows MediaPlayer application is not running visibly.
I've also seen this reference:
http://blogs.msdn.com/ericgu/archive/2004/08/13/214434.aspx
So, I know that there are people out there who have succeeded in getting this to work, apparently in something as simple as 100 lines of C++ code in a header file.
Any pointers?
dk
|
|
|
|
|
Hi All,
I hope that this isn't a terribly obvious question, but here goes. I've created a typed dataset using the dataset tool in Visual Studio .NET. I'm pretty mpressed with the results, but I'd like to be able to stick the picture of the dataset into a word document. Short of printscreen, I don't see how to do this.
Anyone have any ideas? Are there any tools to create a metafile, or something similar from the .xsd and .xsx files?
Thanks
|
|
|
|
|
I understand that we need to draw hotspots around a control and then check to see if the spots are clicked... then we can resize the control accordingly.
now my concern here is what to use as a hotspot? because if I just use the Graphics.DrawRectangle, then I cant assign handle-events to the rectangles I draw.
Thank you so much for your help.
Elapid For The Win
|
|
|
|
|
Well, if you don't want to handle that in your main OnClick, I guess you can derive something from Control that draws a rectangle. I guess it's nice from an OO POV, but it seems to me like a lot of work to know when someone clicks on a rectangle.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
How do I hide a DataColumn in a Datagrid?
TIA
------------------
I'm naked under my clothes...
|
|
|
|