|
|
Wow...so to just to add a new icon resource the above mentioned stuff needs to done!!!
So all this logic is included for App.ico? (the default icon for a form)
Thx for ur hlp.
Don't and drive.
|
|
|
|
|
I am working with IE Browser Control. When a new window event occurs I get that breakpoint no problem by implementing an axWebBrowser1_NewWindow2 method in my form.
However, I seem unable to get a handle to the new browser for that new window.
I am trying to set the ppDisp of the event like this:
e.ppDisp = axWebBrowser2.Application;
This allows the new window to show up, but I'm not sure that my axWebBrowser2 object is actually being used ?
I am unable to tie into its DocumentComplete event ? That is my question.
I tried setting a delegate to it like this:
axWebBrowser2 = new AxSHDocVw.AxWebBrowser();
this.axWebBrowser2.Application.DocumentComplete += new AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.testHandler);
The "testHandler(sender,event)" method is not being called when the new window shows and its document is loaded ?
Thanks in advance for any help on this - mike.
Zeno Rocks
|
|
|
|
|
This code works for me (OnDocumentComplete is triggered from the right Form instance) :
private void OnNewWindow2(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e)
{
Form1 newwindow = new Form1();
newwindow.Text = "(new browser window)";
e.ppDisp = newwindow.axWebBrowser1.Application;
newwindow.Show();
}
|
|
|
|
|
Thanks to .S.Rod for the suggestion. I was missing the form. Yeah this seems to now work - great !!
Zeno Rocks
|
|
|
|
|
Is there any way to append RTF text from one RichTextBox control to another
RichTextBox control.
Sonork ID 100:25668
|
|
|
|
|
I've not had a need to work with the C# RichTextBox, but with the ActiveX one, you could do
rtf1.SelRTF=rtf1.SelRTF + rtf2.SelRTF;
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I tried following already but do no seem to work.
rtbMessage.SelectAll();
rtbDisplay.SelectAll();
rtbDisplay.SelectedRtf = rtbDisplay.SelectedRtf + rtbMessage.SelectedRtf;
Sonork ID 100:25668
|
|
|
|
|
Hi !
I've created my custom browser using the AxSHDocVw.AxWebBrowser
The object created is called with in a form that I developed.
Now when I maximize the parent window the child window ( the AxWebBrowser )
is not maximized with it.
I've used the following piece of code to handle the problem bu tit doesn't seem to work.
this.myBrowserInstance = new AxSHDocVw.AxWebBrowser();
InitializeComponent()
{
...
this.MaximizedBoundsChanged += new System.EventHandler(this.Form1_Maximize);
...
}
private void Form1_Maximize(object sender, System.EventArgs e)
{
...
System.Drawing.Size sizeOfBrowser = new System.Drawing.Size
(this.MaximizedBounds.Width - 10, this.MaximizedBounds.Height - 10);
myBrowserInstance.ClientSize= sizeOfBrowser;
...
}
Please help !
Thanx in Advance !!
((
|
|
|
|
|
This code is irrelevant.
To make sure the web browser is maximized or scaled accordingly to the parent window, you can use anchors/docks from the IDE / Properties.
|
|
|
|
|
Thank you very much
|
|
|
|
|
I have the following function:
void IVSSItem.Get(ref string Local, int Flags)
I try to use it the following way:
string fullPath = "some path";
vssItem.Get(fullPath, 0);
I get the following compilation error:
Argument '1': cannot convert from 'string' to 'ref string'
Anyone know how to use a ref string ? I tried typecasting, using the class String , and declaring the fullPath local var to be of type ref string , to no avail.
|
|
|
|
|
|
Tx Dan
|
|
|
|
|
How do you do that? In C, I would have done something like:
FileAttributes &= ~ReadOnly;
How do I do that in C#?
|
|
|
|
|
|
And what was the answer? I am having the same problem figuring this out...
|
|
|
|
|
Alright,
Heres my question for all of you guru's out there. I have a main form, which is a mdi container. Inside this mdi container, aligned to the left side, is a tree view control with various menu options. When a user selects an option from the treeview control, various "main" forms are loaded, which stretch from the right side of the tree view control onto the rest of the form. Almost as if you had your favorites toolbar open on internet explorer. Now from each main form, you can navigate to a from from this main form. For instance, if the main from displayed various personnel with a datagrid control, you could hit an edit button, and have a form replace the main from with a personnel edit form. So it is possible to navigate forms from the treeview control and the various main forms that the treeview loads. The tricky part is this, I have to beable to implement back and foward buttons for the application, just like in IE. So what Im doing is creating a method of the main, container form.
Something like this
private void HandleForms(Form frmCurrent)
{
try
{
if(frmCurrent != null)
{
if(m_cCurrent != null)
{
m_cCurrent.Close();
}
m_cCurrent = frmCurrent;
m_cCurrent.MdiParent = this;
m_cCurrent.Dock = DockStyle.Right;
//m_cCurrent.SetDelegates(m_dlgNotifyMain)
m_cCurrent.Show();
m_aForms.Add(m_cCurrent); //arraylist of forms for back foward
}
}
catch(Exception e)
{
MessageBox.Show(e.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
As you can see, I just simply set a member level form variable equal to
whatever form that the method is passed. I close the previous form and
load the new form. But in order from me to allow the main forms to also
load there own edit forms for example, I need to pass a delegate reference
to those main forms, hence my commented out setdelegate method call. It obviously wont let me use a method call on the generic form class like that. Because the form class could be set equal to any of 10 different forms. Im totally at a loss, here are my main problems
1. If i need to pass a delegate reference to a newly loaded form, and your
not positive at design time which form you need to pass the delegate, how do you accomplish this. I wasnt able to get casting to work, or an interface.
If anyone could help me or point me to a tutorial or something I would greatly appreciate it.
Ryan
|
|
|
|
|
Ryan@SalamanderTechnologies wrote:
If i need to pass a delegate reference to a newly loaded form, and your
not positive at design time which form you need to pass the delegate, how do you accomplish this. I wasnt able to get casting to work, or an interface.
Simply pass the reference to the base class: Form.
BTW, I'd bet that this would be easier to implement with each form as a property page or user control, since MDI is, as the name states, document oriented, you'll soon bang your head in some wall.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Well how would I pass the reference to the base class? I created methods with in ech of the forms called SetDelegates(passed delegate) which allowed me to do this. How would I pass it to the Form base?
Thanks for your reply,
Ryan
|
|
|
|
|
I realized what you were talking about. I simply created a class called AbstractForm, and I inherited the System.Windows.Forms.Form on this one base class. Then I inherited all the other forms off of this base class that I created. Inside this base class I have one method, the setdelegates method.
Thanks for your help,
Ryan
|
|
|
|
|
We are assuming that the browser control creates an interface to whichever browser happens to be installed on the client machine. With the browser control in our Windows Form client, how do I discover the version of the browser that I'm communicating with? We'd like to be able to display that version in our testing tool for test validation. Any help is appreciated!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
There can be only one Internet Explorer version installed per OS.
Extracting the version is a matter of either :
- reading the following registry key : HKLM \ SOFTWARE \ Microsoft \ Internet Explorer (System.Microsoft.Win32)
- getting the file version info of <sysdir>\shdocvw.dll (System.Diagnostics.FileVersionInfo)
|
|
|
|
|
My new adventures with C# have brought me to discover the ArgumentException (and derived) classes. They're convenient for raising an exception if a method parameter is not valid.
So now I'm questioning the usefulness of Debug.Assert statements, which I've long used to check method parameters. In other words, whereas before I would use Assert to verify the parameters were in good shape, now I'm thinking that it's better to take a more active and aggressive approach of throwing an ArgumentException if they're not. So I've basically taken out the Assert statements and replaced them with "if parameter is bad, throw new ArgumentException" lines.
In your opinion, is this a better approach? I suppose I could still leave the Debug.Assert statements in there, on top of the exception lines, but it seems like too much extra code. I mean, exceptions do the job always, and once they're caught, I can find out what the problem is -- basically like Assert statements do. So why even bother with the extra Assert statements? See my dilemma?
What approach do you take?
I appreciate your comments,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Both of them have their place. In my mind the simplest distinction is that Assertions are used for debugging (for the programmer) and Exceptions are used for graceful error handling (for the end-user). I don't think that a production ready application should ever be causing assertions, though. So, my answer to your question is "use both"--assertions to debug your code and exceptions to handle errors gracefully.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|