|
I have a small ActiveX Control in C# (Windows Form rendered as ActiveX using OBJECT tag) and rendered in IE.
How can I refer the document loaded in IE from within this ACtiveX Control instead of redundantly downloading it again using WebClient.
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Chances are the IE address bar is visible, then the easiest thing I think of is to use Spy++, get the control ID of the address bar, then used standard windowing to retrieve the content of it.
Namely, get the window handle and/or control id of the underlying
editbox, then a mere ::GetWindowText(hWnd, str) will get what you need. (I am speaking in C++ terms but I guess you'll find out easily how to translate the words in C#).
|
|
|
|
|
How are you downloading it, and to where? A WebBrowser control?
"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
|
|
|
|
|
Can anyone tell me syntax to filter on child rows of a dataset or DataViewManager
I want to display in a datagrid, all the parent rows who have a particular text value in a column in the child table.
So far I have tried:
dataset.Tables["client"].DefaultView.RowFilter = "Child(relationName).category = 'TextValue'";
and
dataset.Tables["client"].DefaultView.RowFilter = "Max(Child(relationName).category) = 'TextValue'";
The first one returns all parent rows regardless of the child column value and the bottom one only returns the parents who ONLY have one child row that matches the 'TextValue'... parents that have one matching row and other child rows with non-matching rows do not show up...
Any help appreciated
Cheers
|
|
|
|
|
What is the difference between using the AppendText method to concatenate a string to another and using the + operator for the same purpose? Is using the AppendText method more efficient or there is no difference at all?
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
|
Hi All!!
can some one tell me exact code to get the row count of data grid.
sorry for my bad English.
|
|
|
|
|
You can get row count for instance as:
1. If DataSource is a DataTable
((DataTable)myGrid.DataSource).Rows.Count
2. If DataSource is a DataSet
((DataSet)myGrid.DataSource).Tables[myGrid.DataMember].Rows.Count
etc. with DataView. Next problem - DataGrid can have some sources (like DataSet). You must specify, what DataTable rows You want to count.
Next solution it is to use protected DataGrid property ListManager in inherited object:
((DataView)this.ListManager.List).Count
Hi,
AW
|
|
|
|
|
Thanx
sorry for my bad English.
|
|
|
|
|
Does anyone know if I can formatonly part of the TextBox.Text property.For Example if I assign Textbox.Text = "Hello World"; , is it possible to make word "Hello" red and "world" blue?
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
As far as I know, not unless you impliment the text property yourself in a subclassed control.
You might want to try using an RTF control.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Override Paint() ore something like this in class inherited from TextBox I think
Hi,
AW
|
|
|
|
|
How I can receive emails from SMTP server using Outlook object ? (Outlook XP v10)
|
|
|
|
|
have you gone thru GDN
www.gotdotnet.com site.
you can get excellent samples there. !!!
here is the smtp sample for you !!!
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=958BAB96-82EF-4ACD-8F16-8725A2DEA946
Paresh
|
|
|
|
|
Using C# in a winform, I'm creating a file backup program that uses a treeview/listview pair, just like Windows Explorer, only exception is that all entries have checkboxes for selection... you make your selections and then save a backup file (in XML) containing a record of all dirs/files for that job. Works fine.
In order to edit a saved job, the treeview/listview pair must be "re-hydrated", so that all selections for a given job are restored and the user can view and make changes.
I know you can programmatically check/uncheck items, but I'd like to make the selections by sending mouse click messages, just as if I were making the selections for the first time with a mouse... can't use the "node.Check = true" method because it conflicts with my job creation logic.
Is it possible to send mouse click messages programmatically...??? How is it done...?
thanks very much.
|
|
|
|
|
you can Invoke the tree's onmouseclick event with that when you fill the tree event object fill the node you want so as if it clicks on that item.
Paresh;)
|
|
|
|
|
thanks for the reply... can you give me more info or an example of how I can send a mouseclick message to the treeview entry...???
thanks...
|
|
|
|
|
Ok Here is the code what I tried !!!
you can compile and run under shell by
> csc Form1.cs
> Form1
you can derive the TreeView Class and make protected method callable via making public and calling protected method.
Hope this helps or gives hints to your stuff !!!
----------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WinTreeHandle
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private WinTreeHandle.Form1.MyTree treeView1;
class MyTree : TreeView
{
public void OnMyAfterCheck(TreeViewEventArgs e)
{
e.Node.Checked = true;
this.OnAfterCheck(e);
}
}
private System.Windows.Forms.Button buttonClick;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
bool bLoading = true;
public Form1()
{
bLoading = true;
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
bLoading = false;
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.treeView1 = new WinTreeHandle.Form1.MyTree();
this.buttonClick = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.CheckBoxes = true;
this.treeView1.ImageIndex = -1;
this.treeView1.Location = new System.Drawing.Point(16, 24);
this.treeView1.Name = "treeView1";
this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node0"),
new System.Windows.Forms.TreeNode("Node1"),
new System.Windows.Forms.TreeNode("Node2"),
new System.Windows.Forms.TreeNode("Node3"),
new System.Windows.Forms.TreeNode("Node4")});
this.treeView1.SelectedImageIndex = -1;
this.treeView1.Size = new System.Drawing.Size(208, 144);
this.treeView1.TabIndex = 0;
this.treeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterCheck);
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// buttonClick
//
this.buttonClick.Location = new System.Drawing.Point(240, 32);
this.buttonClick.Name = "buttonClick";
this.buttonClick.Size = new System.Drawing.Size(96, 40);
this.buttonClick.TabIndex = 1;
this.buttonClick.Text = "Click To Raise Event";
this.buttonClick.Click += new System.EventHandler(this.buttonClick_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(344, 221);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.buttonClick,
this.treeView1});
this.Name = "Form1";
this.Text = "Tree Handling";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void buttonClick_Click(object sender, System.EventArgs e)
{
TreeViewEventArgs e1 = new TreeViewEventArgs(treeView1.Nodes[0],TreeViewAction.ByMouse);
treeView1.OnMyAfterCheck(e1);
}
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if ( bLoading ) return;
MessageBox.Show(e.Node.Text);
}
private void treeView1_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if ( bLoading ) return;
MessageBox.Show(e.Node.Text);
}
}
}
-Paresh
|
|
|
|
|
Please check this code first:
Console.Write("{0}-{0}","2");
I want it to write "2-{0}" not "2-2". How can I do this?
|
|
|
|
|
I don't know how to escape {0} , but there's another way to do what you need:
string value = "2";
Console.Write(value + "-{0}");
Regards,
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
|
|
|
|
|
try \{
that's the escape sequence char.
|
|
|
|
|
pareshgheewala wrote:
try \{
that's the escape sequence char.
Well, that doesn't work too, I don't really know the escape character for this but you could use the following workaround
Console.Write("{0}-{1}", 2, "{0}");
that will result:
2-{0}
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
hey I found it, just use {{ and }}
Console.Write("{0}-{{0}}",2);
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
Hi:
I'm working on a custom control that inherits System.Windows.Forms.Control. What I need the PropertyGrid control do is to hide most of the inherited properties of my custom control. There is a property BrowsableAttributes that is probably meant to do the job but I don't have the slightest idea how this is done! Is it possible for the PropertyGrid to show only the properties I specify?
10x,
Kaloyan
|
|
|
|
|
Using the attribute "[Browsable(false)]" should do the trick.
As an example ...
[Browsable(false)]
public string MyStringProp
{
get {....}
set {....}
}
would prevent the property grid from displaying the properity. Setting it to true then would allow the grid to display the properity.
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|