|
Thomas W wrote:
// Add mouse text
public void Main()
{
strText = "I'm dog. ";
Mouse myMouse = new Mouse(ref strText);
myMouse.AddMouse();
Console.Write(myText);
}
Where is myText declared?
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Not with strings, since they are immutable (their contents can't be changed), which means upon any change, a new string object is created, and any pointer to the previous one does not reflect the change (except when passing as a ref in a function call).
However, you can use a StringBuilder instead, who's contents can change without reallocating the class object itself. Your code idea will work with a StringBuilder, although that means all relevant code will have to use one.
|
|
|
|
|
Ok, Thanks for explanation.
|
|
|
|
|
Hi, all:
I am using Datagrid control in my WinForm application. I have two questions regarding the usage of the datagrid control.
1. In MS Access Database, you can specify a column "Lookup" to another table for available values ( show up as List when clicked on the cell ). Can I do the same thing in Datagrid control?
2. I'd like the user to update the data in the datagrid, but not add a new row. I will programatically add new rows through Dataset. Is this possible?
Thanks for your help in advance.
Dion
|
|
|
|
|
1. Yes. You can create class "DataGridComboBoxColumn" etc. using ComboBox and DataGridColumnStyle
public class DataGridUniPoleColumn : DataGridColumnStyle<br />
{ ... }
as it's written in help.
2. Property AllowNew (of DataView) to allow/deny adding new row by user is in ((DataView)ListManger.List) property (protected) of DataGrid -or- in Your view used by DataGrid -or- in DefaultView property of DataTable in the DataSet. You can add row to DataTable.Rows or to DataView using Add().
Your problems are much more complicated ... see help.
Hi,
AW
|
|
|
|
|
I'm trying to change the IP address of a Win2k machine, preferably without rebooting it, but there seems to be no info how to go about it!
Anybody any ideas ?
|
|
|
|
|
I have a dataset with two tables (Category, Element) and one relation between them (every row in Category has several rows in Element). At start I saw the Category lines and clicking the (+) sign could navigate to elements.
Problem: when a sublist of elements are shown corresponding to one catgory how can I know with wich category I work with (I need to know also the number of lines in the grid). If I want to iterate through elements I need to know the category.
Please help me!
|
|
|
|
|
This place here might not be the appropriate one to ask this question.
I've checked Borlands website but I'm still not clear enough. Will Borland integrate the .NET technology into their products (Delphi, or even a C# compiler)? What can we expect from them?
(I might need to learn delphi soon but I like .NET best for now;)
thank you
|
|
|
|
|
I believe they are trying to bend over. Like Macromedia.
|
|
|
|
|
Hi,
I'm working on a C# Winform application to manage content in a electronical schoolbook. One of the key feautures is a WYSIWYG HTML editor, where the author can format the output text on her own.
At the moment I don't quite know where to start building this feauture. I've done some research, and figured out that there are two components i could use, a) the DHTMLEdit ActiveX component, or b) the MSHTML COM objecct (correct me if I'm wrong). Most of the information i could find about the DHTMLEdit is datet 1998/1999, and is "old". I've allso seen some newsgroup post saying that Microsoft is outfasing DHTMLEdit, and are suggesting you to use the MSHTML object.
What i wan't to know, is witch one of these two components i should use to build my WYSIWYG HTML Editor. What's the main differences, and how could i as easy as possible implement the feauture in my application. The best thing whould be if i could buy a out of the box editor, witch I could include in my project. I know there are plenty of webbased editors out there, but i wan't something that's winforms.
I would allso appreciate any kind of good information about witch path to take.
Thank you
Jonas Follesø
Developer, GreIT AS
http://www.greit.no
|
|
|
|
|
Hi Mr. Follesø,
Found this at Google (http://groups.google.com/groups?q=MSHTML+vs.+DHTML):
"...as many of you know Microsoft has recently published an article stating that the DHTML Editing Component will no longer be updated or supported as an HTML Editing interface. Instead they have said that developers should migrate their applications to the many interfaces provided by MSHTML. The article also explains that the DHTML control was simply a wrapper component for MSHTML in the first place. To me this means that every function provided and exposed by the DHTML control can be rewritten into your current application..."
Based in this you should drop the DHTML Editing Component and consentrate your development effort on MSHTML.
Håper dette kan være til hjelp.
Regards
Andreas Kongelstad
Computer Programmer
http://www.kongelstad.no
|
|
|
|
|
Hi Andreas,
so you're from norway as well.. Had a look at your website, it looks realy nice
I read something like that post my self, and agree that you should concentrate on the MSHTML com object. The dissadvantages about doing this is that 1) it's a COM object, so you have to write some sort of wrapper to be able to take advantage of the object in .NET. b) Another (norwegian) developer i discussed this issue with, said that the DHTML Editing component got some greate built in table/row/cell support, (insert row, insert cell, insert table etc.) witch the MSHTML object don't. But, i guess if the MSHTML object is so easy to use, you could simply write you'r own table methods.
Done any thing work on the MSHTML component your selfe? Correct me if i'm wrong: MSHTML == the biggest COM object in IE5.5+, and is actualy just a "HTML Parser object"?
- Takk for hjelp, hilsen fra Finnmark;)
|
|
|
|
|
Hi again Jonas,
I have never used MSHTML component before. I am currently using the DHTML Edit Control in a publishing system with great success.
I have put some material for you to download at my site.
|
|
|
|
|
I want add some behaviors for DHTML Element.Can somebody give some suggestions.
gxuqin
|
|
|
|
|
|
I am working with some Win32 interop and handling a windows proc. The lParam value, which is typed as long, actually holds a struct. So I define the struct as below, but I am unclear on how to convert the lParam value into a valid variable of type CWPSTRUCT.
I tried using (CWPSTRUCT)lParam.ToPointer() but that didn't compile. I know I'm close I'm just not sure how to cast it properly.
[StructLayout(LayoutKind.Sequential)]
public struct CWPSTRUCT
{
public IntPtr lParam;
public IntPtr wParam;
public uint message;
public IntPtr hWnd;
}
|
|
|
|
|
Ok I think I am halfway there. I have used Marshal.PtrToStructure, but its giving me a runtime error that the structure must not be a "value class". The docs mention that Marshal.PtrToStructure don't support value types, but I'm not sure what that means.
How else can I define my struct to get around this?
|
|
|
|
|
Use Marshal.PtrToStructure(IntPtr, Type) :
CWPSTRUCT cwp = (CWPSTRUCT)Marshal.PtrToStructure(pCWP, typeof(CWPSTRUCT));
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
I would like to display a set of dates in long format but want to keep all days months and years underneath each other with in a set of text boxes eg
01 January 2003
12 May 2005
14 December 2002
This is similar to how the datepicker works. If I use a space character the years do not line up as all space becomes compressed.
Any Ideas on the character I need to pad out the text with??
Thanks
Steve Graham
|
|
|
|
|
Not sure if this is possible, but try replacing the space character with a tab character, and then set the tab stops for the text boxes. This is the way I would do it with edit boxes or list boxes in MFC or Win32.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Is there any way to use the IActiveDesktop interface in c#? The only reason I want to do this, is to change the desktop wallpaper, but SystemParametersInfo only works with .bmp files. Is there some other way to do this?
|
|
|
|
|
How can I add an internet explorer type window to an application to display HTML.
|
|
|
|
|
|
emm..I hope this is what you are looking for.
If you are using VS .NET you can add a toolBox refferance to "Microsoft Web Browser" (swdocvw.dll)
The object can now be dragged and dropped onto a form.
And to navigate, assuming object is named axWebBrowser:
We have access to
axWebBrowser.Navigate("s_URL", ref, ref, ref, ref)
axWebBrowser.GoHome();
axWebBrowser.Refresh();
axWebBrowser.GoBack();
axWebBrowser.GoForward();
axWebBrowser.Stop();
etc
gadget
|
|
|
|
|
I am calling SetWindowLong inside my C# Windows Forms app and passing a valid hWnd and the other needed params.
The problem is its returning with error code 127, which the docs describe as:
127 The specified procedure could not be found. ERROR_PROC_NOT_FOUND
Why is this happening? As far as I can tell I've properly declared the function in my project as such:
[DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SetWindowLong (IntPtr hWnd, int nIndex, long dwNewLong);
I don't have the same problem when I call GetWindowLong, only SetWindowLong.
This is pretty frustrating, any suggestions are welcome.
Thanks,
M.
|
|
|
|