|
Manu_81 wrote: Now how do I set and retrieve values to this class.
Through the properties. In C# this looks just the same as getting and setting the field (although the compiled MSIL is different, but you don't need to worry about that). For example:
myMonitor.MonNumber = 2;
myMonitor.EDID_Info = "Some Info";
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Also, I just double checked the code. The NewMonitorDetailsArray property should have been static - so I've corrected that (see updated previous post)
You can access the ArrayList of all NewMonitorDetails by using
NewMonitorDetails.NewMonitorDetailsArray
You cannot set this as it is controlled by the class. But you can perform any methods on the ArrayList (like Add ) so you can modify the contents of the array.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
If you wan't to store any data in the objects, you have to have any non-static members. If you create an object from that class, the object will contain no data what so ever.
If you create an array, you can access it from where ever you like, as long as you have a reference to it. How to best handle that reference is hard to say, as you have given so very little information on what you are trying to accomplish.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have a data source that has the the following method.
.Rows.Add(object[] obj}
How do I pass directly to it an array of parameters within parenthesis? Like the following
...Rows.Add(1, "Hello", "World", 18); or
...Rows.Add("1", "Hello", "World", "18"); or
...Rows.Add({"1", "Hello", "World", "18"});
I get errors like ...Rows.Add() does not take n parameters where n is equal to the number of values I put in. The last one gives me errors about the {} being all wrong.
If I create the following:
object[] obj = {1, "Hello", "World", 18};
...Rows.Add(obj);
Everything works fine.
Cheers,
Clint
|
|
|
|
|
Clint,
Try this Rows.Add( new object[] { 1, "Hello", "World", 18 } ) .
Andy
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Thanks!
That did the trick.
Cheers,
Clint
|
|
|
|
|
Hello,
I had a little question, i made a chat textbox, people can send messages to eachother, the only problem i have is that the scrollbar needs to stay down... after a new message it always goes to the top. I really can't find the method to do that.
I posted a image with the problem.
http://www.theoc.nl/problem.jpg
Thnx in advance
Wouter
|
|
|
|
|
hi!
are you setting the Text property of your textbox?
if that's the case maybe the cursor or the SelectionStart property of the textbox resets to 0 or to the beginning.
try to set the SelectionStart to the end after setting the text.
hope that helps!
|
|
|
|
|
thnx for your reply, let me test
|
|
|
|
|
tb_Player_Messages.Text += _Message + "\r\n";
tb_Player_Messages.SelectionStart = tb_Player_Messages.Lines.Length;
Doesnt really work
|
|
|
|
|
are you having some event from the other controls before setting the text?
like for example, you have to click a button to append the text on your textbox?
if so, sorry but i forgot to tell you that you must call the Focus method of the textbox before setting the selectionstart.
because the focus is on the other control that's why it doesn't show the cursor on your textbox.
and also, instead of "tb_Player_Messages.Lines.Length" use "tb_Player_Messages.Text.Length".
<br />
tb_Player_Messages.Text += _Message + "\r\n";<br />
tb_Player_Messages.Focus();<br />
tb_Player_Messages.SelectionStart = tb_Player_Messages.Text.Length;<br />
i tried it and it works fine.
hope that solves your problem.
|
|
|
|
|
HI,
I have an animation flash file with .fla extension. I want to paly it in one of my form. How do I add it to my form.
Thanks.
|
|
|
|
|
I guees you can put Browser Control on your form ,then display in the control your flash file.
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
That worked !!!
Thanks a lot
|
|
|
|
|
Alternatively you could drop a Flash Player on your form. This might give you more control over playing of the movie and the ability to handle events from the control in your .NET code.
(Add it to the toolbar in VS by selecting it from the COM component list.)
|
|
|
|
|
Hi all,
I am wondering if it is really possible to get the selected text from the Embedded webbrowser control in C# application. It would be a great help.
Thanks and regards
Emran
|
|
|
|
|
This code snippet shows selected text in MessageBox.Don't forget to add reference to Microsoft.mshtml
<br />
IHTMLDocument2 HtmlDoc = (IHTMLDocument2)axWebBrowser1.Document;<br />
IHTMLSelectionObject selection = HtmlDoc.selection;<br />
IHTMLTxtRange range = (IHTMLTxtRange)selection.createRange();<br />
MessageBox.Show(range.text);<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hi Tarsan,
I extremely appreciate your help.
I was trying to follow your tips but I faced two problem,
1] I am using Visual C# 2005 Express (.Net 2) and I dont see the DLL microsoft.mshtml is available for adding. I searched for this dll in google and i did not find it anywhere for download. So, if you have that, can you post that file here ?
2] Second question, I am using the control, "WebBrowser" (.NET 2005 Express edition comes with it), not the "Microsoft Web Browser". So, will your code work for this WebBrowser Control ?
Thanks and regards.
Emran
|
|
|
|
|
Hi Emran.
1) Yo can easy find microsoft.mshtml . Select "Add Reference" in "Solution Explorer" .Add component named "Microsoft Html Object Library" from "COM" tab. The DLL(COM) comes with IE and should be on your computer .
2)Yes, but with small changes and you still need microsoft.mshtml
<br />
IHTMLDocument2 HtmlDoc = (IHTMLDocument2)webBrowser1.Document.DomDocument;<br />
IHTMLSelectionObject selection = HtmlDoc.selection;<br />
IHTMLTxtRange range = (IHTMLTxtRange)selection.createRange();<br />
MessageBox.Show(range.text);<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hi Tarsan,
I am really glad to know that my problem has a solution. I found the library in COM tab, but unfortunately everytime I tried to add that reference, my PC hung. But anyway, I will try and let you know if I had any problem to use that code. Till then, thanks and regards.
Emran
|
|
|
|
|
Hi Tarsan,
Thanks soooooo much, I am very happy to tell you that, your tips are working very nice.
First it did not work, I found that, if i place this header using MSHTML; at the top of the code, then it works.
Thanks again.
Emran
|
|
|
|
|
hi all
i am working in a MDI Application , and i want to disable the autoscroll property of the midi parent form, i had used this but it didnt work
public Form1()
{
InitializeComponent();
this.AutoScroll=false;
}
how to solve this?
|
|
|
|
|
|
very nice and it works good
many thx
|
|
|
|
|
Hi,
I have a stored procedure and it looks like the following
ALTER PROCEDURE USP_NCUInsertContentCodeTest
@var1 int,
@var2 int
etc
AS
DECLARE @RC int
//Do stuff
RETURN @RC
I know how to execute the procedure in c# but I cant figure out how to get the return value. I know if I declared the @RC before the AS I could declare it as a parameter with parameterdirectio = output etc but I cannot change the stored procedure. How can I do it?
Thank you in advance,
Ed
|
|
|
|