|
Too late m8!
Got to that one on my own
|
|
|
|
|
there are lots of examples on how to set up child form from the MainMDI but i cant find anything on how to open a form from another child form and setting the MDIParent so as it becomes child form, where am i going wrong???
|
|
|
|
|
So long as you're not talking about an MDI child form within another MDI child form (which isn't supported in the .NET FCL), you can simply get the parent MDI form of the first child and add the new child as an MDI child of the parent:
MDIChildForm child = new MDIChildForm();
if (MdiParent != null)
MdiParent.AddOwnedForm(child);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
fantastic response and worked first time.
|
|
|
|
|
How can i make a panel that can receive a focus
I used the GotFocus and LostFocus events to turn the panel blue when focussed. But how can i set the CanReceiveFocus Property true so that you can use your keyboard (Tab and arrows) to give that control the focus. (That panel also conatains a picturebox and a label).
Thanks
Jonathan Slenders
|
|
|
|
|
Extend the control and in your constructor call SetStyle(ControlStyles.Selectable, true) .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Hello,
May I know how I can create a 2 dimension textbox array? I know how to create a 1 dimension textbox array, but I am having trouble trying the 2D. Thank you!!
|
|
|
|
|
It depends what kind of multi-dimensional array. There are multi-dimensional arrays and jagged arrays. The former is declared like this:
TextBox[,] boxes = new TextBox[,] {{textBox1, textBox1},
{textBox1, textBox2}, {textBox2, textBox2}}; These types of arrays have fixed dimensions and sizes.
Jaggaed arrays' elements are arrays themselves, like this:
TextBox[][] boxes = new TextBox[] {
new TextBox[] {textBox1, textBox1},
new TextBox[] {textBox1, textBox2},
new TextBox[] {textBox2, textBox2},
new TextBox[] {textBox1},
new TextBox[] {textBox2}}; As you can see, these can have different dimensions and sizes.
You can find more information by reading about Arrays[^] in the Visual C# language documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you
|
|
|
|
|
I've created a component Library, and i've built the P/Invoce commands into it to build a windows style component. However, when i try and run the following lines internaly from the component, or Externaly from the parent window, i get the "DragDrop registration failed."
<br />
pTHEME = ThemeAPI.OpenThemeData(this.Handle,"Window");<br />
<br />
IntPtr pDC = ThemeAPI.CreateCompatibleDC(IntPtr.Zero);<br />
I put a break point after these two lines, and they process ok for each window, producing pointers and executing successfuly. However, the program then skips to the end of the Main method, and throws the error.
Why is it doing this? I've read that it's a problem with Web Deployed Apps in .NET v1.0. But i have V1.1 and it's not a web app.
What can i do to solve it?
Cheers
Cata
Note: I have enabled windows styles as well, so that's not the problem.
|
|
|
|
|
The Catalyst wrote:
IntPtr pDC = ThemeAPI.CreateCompatibleDC(IntPtr.Zero);
I dont know much of themes, but why are you passing a "NULL" pointer? Shouldnt you pass this.Handle instead?
top secret
|
|
|
|
|
I figured my origional problem.
But you do still have a good point. Might explain why it's not drawing anything now.
|
|
|
|
|
Hi
I am planning to start a research on Data Mining techniques for Intrusion Detection. It would be very helpful for me if any one of you cna help me in getting the code for some basic algorithms like Apriori, K-Means hierachical clustering, Decision Tree in C# or C++. Please let me know if any body else is in the same field.
my email id is sreelakshmibobba@hotmail.com
Thanks
srilakshmi
|
|
|
|
|
This book is great, and the code is free to download:
Weka.
It's in Java, but it's easy to migrate it to C# (at least, easier than write ) or to compile it in J#.
Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
|
|
|
|
|
Dear
this is a very important topic and am trying to work on this system for 1 year but i face alot of problem.
the big problem was the Lack of sources
and i depended on C# and SQL 2005 server
i found the same system built in java and oracl
but its very difficult
if you find anything please could you share that with us
thanks brother
|
|
|
|
|
This is the problem/scenario (I hope it makes sense):
I am trying to pass some values from page1.aspx to page2.aspx, NOT with a querystring.
Page1.aspx is code only: no buttons or textboxes. The user will never see page1.aspx.
The values have to be retrieved on page2.aspx, using Request.Form["name"].
So on page1.aspx, I have to ‘submit’ the values to page2.aspx.
There must be some simple way to submit these values from page1.aspx to page2.aspx using C#, but I just don’t see it.
Any help is appreciated!
Thanks.
|
|
|
|
|
You mean you want to submit a form without clicking a button? You can call the __doPostBack client-side function (Javascript) or just use theForm.submit() , although the former is preferred. This is what button clicks, index changes, etc. do on the client-side to post changes back to the server.
Also, if you have questions specific to ASP.NET, you should ask in the ASP.NET forum.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
you could use HttpWebRequest to do a post to a page and then use it's response objecct to retrieve te answer. Not sure what you mean though...
|
|
|
|
|
I am having a problem with using an ocx control in .NET. It works fine in VB 6.0 etc, but I was hoping to use the robust features .NET has over 6.0. My orginal post is here :
http://www.codeproject.com/script/comments/forums.asp?msg=781067&forumid=1646#xx781067xx
The problem breaks down to this - the ocx control is essentially a class with many get methods that access a binary file. Any method which returns a string fail with type mismatch. Here is an example function description in the docs I have:
{EXAMPLE}
GetCreatorID
long GetCreatorID(BSTR FAR* pbstrCreatorID);
Return Value
1 if successful; otherwise, see Error Codes.
Parameters
pbstrCreatorID A valid pointer to a BSTR. This variable must exist and be initialized to NULL.
Remarks
Returns the creator ID. The creator ID is the logon name of the user when the raw file was acquired.
Example
// example for GetCreatorID
BSTR bstrCreatorID = NULL;
long nRet = XRawfileCtrl.GetCreatorID ( &bstrCreatorID );
{END}
I am calling the function in VB .NET like this:
Dim Creator as String
XRawfileCtrl.GetCreatorID(Creator)
This results in a type mismatch
Dim Creator as New StringBuilder()
XRawfileCtrl.GetCreatorID(Creator)
This gives me the error:
Value of type 'System.Text.StringBuilder' cannot be converted to 'String'.
Any method which returns a date, double or int works fine....
any thoughts?
|
|
|
|
|
Use Marshal.StringToBSTR to convert the string to a BSTR , then pass the returned IntPtr to the method. If the parameters is an [in/out] parameters, then use Marshal.PtrToStringBSTR when the method returns to get the string back.
Also, in the future please do not refer to me directly. There's several regulars here that are helpful and could possibly answer your questions too. It's just not very polite.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Sorry Heath! I told him to ask for you because of your in depth knowledge of marshalling...
RageInTheMachine9532
|
|
|
|
|
No problem, really. Just sticking up for the other regulars. I don't want anyone to be offended on my account.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Sorry about the direct request... Dave from the VB forum said to ask you.....
So here is what I am trying:
Dim fName As String
Dim t as String
Dim s As IntPtr
s = System.Runtime.InteropServices.Marshal.StringToBSTR(fName)
XRawfile.GetAcquisitionFileName(s)
t = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(s)
This gives me the error on build that:
Value of type 'System.IntPtr' cannot be converted to 'String'.
This is in regard to calling XRawfile.GetAcquisitionFileName(s)
Also, using the object browser, the method is described like this:
Public Overridable Function GetAcquisitionFileName(ByRef pbstrFileName As String) As Integer
Member of: AxXRAWFILELib.AxXRawfile
|
|
|
|
|
sbeausol wrote:
Dim s as String
Dim t as String
Dim s As IntPtr
You can not declare the same variable as one type and then again with the same name as another type.
- Nick Parker My Blog | My Articles
|
|
|
|