|
You might want to read this[^] little article.
|
|
|
|
|
Ice_LS00 wrote: Ok i'ved made a reference to form1 in form2
Don't ever do that. Use delegates.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you guys. Delegates..... How did i never tought on that....
You just rocked my world
But i still have a doubt. I have read the article about the delegates and found it very useful, but it doesn't solves my problem.
I have a frmMain that calls a child. That childs calls a new child and in that second child i need to update the main. Like this (frmMain - calls - frmChild1 - calls - frmChild2 - updates - frmMain).
Does any one know how to resolve this?
Thanks in advance.
modified on Tuesday, April 15, 2008 7:03 AM
|
|
|
|
|
Hi
Will it be possible to open an excel worksheet in a MdiParent form and still keep the excel functionality? Specifically graphs and pivot tables.
|
|
|
|
|
how to create si/psi editor for Digital Video broadcasting (DVB) using C#.net Language
|
|
|
|
|
One line at a time, I guess.
Any work on video in C# probably involved DirectX, I would think. But, perhaps what you want is more specialised and would require a third party library.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there,
my windows operating system encountered the following error:
user Init.exe-unable to locate component
it prevents me to open my computer at all , after I log on it the error shows up and then the halt on desktop screen .
it could be because of bad installation.
any suggestions ?
and there is a command to be typed in the run to fix and repair the system files from a windows cd, dose someone know what it is?
I appreciate your help
Thanks in advance
There is always something to learn
|
|
|
|
|
Hi,
I am trying to make a webpage with a link. When users click on this link, it launches a webbrowser on my server, do some stuff and return information.
Right now, I have successfully made my code for creating the webbrowser and processing data. But I cant seem to run it from an aspx webpage. It throws the exception :
ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
So now, I m simply trying to instanciate the webbrowser from the webpage and this still crashes as well.
I would really appreciate any help you could give me.
Here is the code that I ve got on my webpage for the link:
<br />
<form id="form1" runat="server"><br />
<div><br />
<asp:linkbutton id="launchBro" text="Launch the Bro" runat="server"><br />
OnClick="broMethod"></asp:linkbutton><br />
<br /><br />
<br /><br />
<br />
</div></form>
When clicked, the link launches this method in this class:
<br />
<br />
using System.Windows.Forms;<br />
using mshtml;<br />
<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
<br />
}<br />
<br />
[STAThread]<br />
public void broMethod ( Object s, EventArgs e)<br />
{<br />
<br />
WebBrowser mybro = new WebBrowser();<br />
<br />
<br />
}<br />
<br />
}<br />
<br />
I also tryed to simply copy my class creating the webbrowser which is working into this project and instantiate it from this method, but it doesnt work either.
Thx,
Mathieu
|
|
|
|
|
Try adding the following attribute to the page: ASPCompat="true". From this[^] web-page.
|
|
|
|
|
Hi, Ed.
So far, I got rid of this exception by setting the following thread attribute : SetApartmentState(STA)
the [STAThread] does not work
<br />
<br />
public void CreateAccount ( Object s, EventArgs e)<br />
{<br />
Thread mystaticth = new Thread(new ThreadStart(Threadbrowsee));<br />
mystaticth.SetApartmentState(ApartmentState.STA);<br />
mystaticth.Start();<br />
<br />
Server.<br />
<br />
}<br />
<br />
<br />
public static void Threadbrowsee()<br />
{<br />
<br />
SimpleWebBrowser go = new SimpleWebBrowser();<br />
<br />
}<br />
So this does not throw any exception but it still does not do the work. ) It just doesnt do anything.
I think your stuff is the stuff though. I m gonna investigate the Server.CreateObject and keep you inform.
Thx much for the help,
Matt
|
|
|
|
|
No you don't need the Server.CreateObject thing. What's happening is that I don't think you can apply the STAThread attribute anywhere except the Main routine of a C# program. Since ASP.NET websites don't and can't have a Main function then you can't apply it. However what that page described was the way to force a page into ASP compatibility mode which I understand is a Single Threaded Apartment model.
This might achieve what you want. Out of curiosity if you're simply wanting to parse the HTML returned throught the web-browser using a DOM (i.e. without having to parse the strings manually) you should check out the HtmlAgilityPack which provides a strongly-typed way of parsing non-xml compliant html. Works quite well apart from its lack of (at the time) support for LINQ.
|
|
|
|
|
Dear Firends,
I am going to do an windows application which can use webBrowser control i am providing an scenario what i want to do,
supposed i open any site in that webbrowser control example google if i enter text "My Name Santosh" in Search Text Box of google i want to stored this search text in my database with the date time and any other information, For that i use HtmlDocument (For Document), HtmlElementCollection (For collection of control) and HtmlElement (for single control) class now i get the property of that control but i can't access the Value of that Search Text box. when i check that control variable in QuichWatch it show me the value property in
-Non-Public members
-htnlElement
-mshtml.HTMLInputElementClass
-value "My Name Santosh" stringbut i don't know how can i access this value property , can anyone help me regarding this, thanks in advance.
Thanks and regards
Sasmi
|
|
|
|
|
how can i show windows form in fixed size.
amit
|
|
|
|
|
By setting it's frame so that it's not sizable ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
In my code, if I assign a dataset to the combobox datasource property,it is not getting assigned. The combobox datasource remains null. Because of this the combobox is not getting populated with the data.Can Some one tell me what could be the problem
B.RAMYA
|
|
|
|
|
A couple of things occur.
1. Is this an ASP.NET app? I'm asking, because even though you've posted in the WinForms section I don't want to make any assumptions. If so, you need to call DataBind().
2. Have you set the DisplayText/DisplayValue?
|
|
|
|
|
It is a C# .net application and I have set the Display Member and the value member .The thing is that combobox datasource remains null even after assigned with a dataset.
B.RAMYA
|
|
|
|
|
|
I have the following code in my application
m_DataTable= XmlDataSet.XmlToDataSet(xmlOutput).Tables[0];
While debugging I have checked the value of m_DataTable and it has data.But datasource of the combobox remains null even after assigning.
cboTypeID.DataSource = m_DataTable;
cboTypeID.DisplayMember = "Play";
cboTypeID.ValueMember = "Play";
cboTypeID.SelectedIndex = -1;
The thing is that the same code Works fine in others Systems
B.RAMYA
modified on Friday, April 11, 2008 1:29 AM
|
|
|
|
|
I asked if it was an ASP.NET system - not C# (that seemed to be a given). If it's an ASP.NET page, you need to call DataBind() after you set the data source.
|
|
|
|
|
I have a UserControl with several other controls on it - GroupBox, RadioButton etc. When the control is on a form its BackColor can sometimes clash with the current windows display mode because the BackColor is set to Control (I have tried setting it to Window and the same happens)
How can I get the UserControl to not clash with the Window setting (on Aero, Windows Classic etc)
|
|
|
|
|
Hi,
I am working on C# 2.0 windows application, I have to save some xml files in a folder which is hidden, without changing its hidden attribute.
(I am able to save it in same folder when i unchecked its hidden-property).
plz do needful
thanks in advance!
Ahuja
Ahuja
|
|
|
|
|
Please don't cross post.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
Is there a method to obtain all windows created from a parent window?
It must be done from the outside, knowing only the handle to the parent window.
I tried EnumChildWindows, but it only gets handles to child controls, not to windows dynamicaly created by calling (new Form()).Show(), or messageBoxes.
I'm pretty new to forms, don't know if this is even possible
Thanks
|
|
|
|
|
EnumChildWindows returns all of the controls AND forms, since a form is just another control under .NET.
In Windows terms, every control, like button, textbox, combobox, is a seperate window.
|
|
|
|