|
Hi,
I'm trying to catch an event fired by a radio button in a html page.
for this reason I created a console application in c#.
Until now, I managed to open an internet explorer instance,
and got a connection to the document via the mshtml.IHTMLDocument2 function.
After receiving the documentcomplete event my eventhandler mthlEvents.onmousedown
reacts if I click in the Internet Explorer with the mouse.
But my Radio Button is not marked and I see no way, to catogorize between different
Radiobuttons (i.e. No.1 and No.2).
I tried the example by Nikhil Dabas: Handling Document Events, too.
But the axshdocvw.dll is not available in a console application.
The shdocvw.dll which I'm using does not know the
DWebBrowserEvents2_DocumentCompleteEvent.
So I can't run this sample.
If somebody is more specialisted than me, please contact me.
Thanks Sonja
|
|
|
|
|
hello,
how I can make a shortcut for button in .net smart device application (or key accelerator)?
Ignatov
|
|
|
|
|
hi,
is it possible to run a method with parameter in new Thread like this?
public void WorkerThread(int a, String b)
{
// worker thread
}
public void Main()
{
Thread th = new ThreadStart(WorkerThread); // want to pass int a, String b to WorkerThread(), how can do that?
}
|
|
|
|
|
1. Pass the variables
2. Start the thread
public class WorkerClass{
int a;
String b;
public Thread GetThread(int a, String b){
this.a = a;
this.b = b;
return new Thread(new ThreadStart(ThreadMethod));
}
private void ThreadMethod(){
//do something
}
}
public void Main() {
Thread th = WorkerClass.GetThread();
}
|
|
|
|
|
How i can make that when i scroll one textbox (multiline=true) the second will be set at the same position like first???
Greetings
S_W
|
|
|
|
|
Why don't u do something like this: when a scroll event happens in the first text box, invoke another on the second text box?
|
|
|
|
|
Yea i know but how i can scroll another textbox??
Some idea?
S_W
|
|
|
|
|
I just created my first "Class" library and now I want to use it in my code. I added the Class Library by using the "Add Existing Item" from the Project menu and selected MyString.cs. When I try to build the project, I get an error message on line:
textBox2.Text = MyString.NumericOnly(textBox2.Text);
The build output says: d:\mcp2003w\WindowsApplication1\Form1.cs(179): The type or namespace name 'NumericOnly' does not exist in the class or namespace 'MyString' (are you missing an assembly reference?)
The code for the Class Library is:
using System;
using System.Text;
namespace MyString
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class MyString
{
public MyString()
{
//
// TODO: Add constructor logic here
//
}
public string NumericOnly(string input)
{
char[] textin;
int i;
StringBuilder textout;
textin = input.ToCharArray( );
textout = new StringBuilder( );
for (i=0; i<textin.Length; i++)
{
if (textin[i] >= '0' && textin[i] <= '9')
textout.Append(textin[i]);
}
return (textout(ToString());
}
}
}
Any idea what I did wrong??
Thanks,
Glenn
|
|
|
|
|
Well one solution is to change the namespace to match the namespace of your project. There might be a better one out there but that should do it.
|
|
|
|
|
That may do it, but I want to be able to use this library for multiple projects. I thought that was the idea behind object oriented programming. Building parts..
Glenn
|
|
|
|
|
gmhanna wrote:
I added the Class Library by using the "Add Existing Item" from the Project menu and selected MyString.cs.
If you want to add reference to your Class library use "Add Reference" from Project Menu. Then if your class MyString is in namespace MyNamespace you can use it in another project like this:
using MyNamespace;
MyString str=new Mystring();
string s=MyString.NumericOnly("1234a");
or
MyNamespace.MyString str=new MyNamespace.Mystring();
string s=MyNamespace.MyString.NumericOnly("1234a");
In your code you are not using MyString namespace so compiler thinks that MyString is namespace and not class as you wanted.
Hope this will help
i'm only pointer to myself
|
|
|
|
|
I need to know how to get a specific pixel's color on a panel, lable or image???
Leon v Wyk
|
|
|
|
|
Use the GDI+ GetPixel method
|
|
|
|
|
Hi...I'm trying to call an API, which takes a pointer to a structure that contains unions. I'm not sure how to build this in C#. Where I'm having difficulty is what to do for the unions and how setting a length for the character array. I know I'm going to have to use UNSAFE code for the dereferenced pointer.
I have enclosed the subset of the structure below...
typedef struct CCVUSER
{
SHORT TransactionType;
SHORT ProcessingMode;
PVOID pvBatch;
UCHAR uchErrorText1[255];
UCHAR uchErrorText2[255];
UCHAR uchSettingsPath[255];
union CCV
{
struct CreditCard
{
CHAR *CardInfo;
CHAR TransactionDate[4];
CHAR InvoiceNumber[10];
double CashBackAmount;
double TipAmount;
double Amount;
BYTE CustomerPresentFlag;
} CreditCard;
struct CheckApprovalRequest
{
CHAR IDType[2];
CHAR Number[26];
CHAR DateofBirth[6];
double Amount;
CHAR CheckSequenceNum[4];
} CheckApprovalRequest;
} CCV;
} CCVUSER;
Thanks for your help...
Glenn
Glenn
|
|
|
|
|
Here is a C style union in Csharp.
Out of the best Book I have read so far for .Net.
Essential .Net Volume 1.
[StructLayout( LayoutKind.Explicit )]
public struct Number
{
private enum NumType
{
Double,
Int64
}
[FieldOffset( 0 )]
double dblValue;
[FieldOffset( 0 )]
long lngValue;
[FieldOffset( 8 )]
NumType type;
public void Set( double value )
{
type = NumType.Double;
dblValue = value;
}
public void Set( long value )
{
type = NumType.Int64;
lngValue = value;
}
public double GetDouble()
{
if ( type == NumType.Double )
{
return dblValue;
}
return (double)lngValue;
}
public long GetLong()
{
if ( type == NumType.Int64 )
{
return lngValue;
}
return (long)dblValue;
}
}
Thank You
Bo Hunter
|
|
|
|
|
|
|
Create a new child form with transparent areas. Open these up when required.
|
|
|
|
|
Hello.
If a function like OnMouseMove is implemented in a derived class, without any message map info, this function gets called when the event occurs. How is the housekeeping done on this? One would think there is an overhead of calling all the event functions irrespective of wether it is implemented or not. Or is an optimization done at compile time?
Any useful links or explanations on this would be helpful.
Thanks in advance.
Regards,
Priyesh
|
|
|
|
|
Event handlers are basically a linkedlist of function pointers. The standard implementation will check whether the event handler is null, otherwise it will invoke each function pointer (delegate) in the eventhandler.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Does this mean that delegates and Onxxx functions use the same mechanism to deliver events?
|
|
|
|
|
Hello,
I've set up a site for my company which pulls content links from the database and binds them to a repeater which produces a list of linkbuttons with the text and link to the appropriate story. However, a great deal of importance has been attached to search engine placement and the ability of spiders to travel unimpeded throughout the site. Since a linkbutton does not produce a conventional url which can be followed by a spider, is there any piece of data that a linkbutton can produce allowing a spider to travel to the displayed link?
Thanks for any help you can provide.
|
|
|
|
|
I had the same problem with a Flash based menu. The best is to make some "invisible" links somewhere
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I have a question abount Socket Communication.
When Socket Connection was founded with Server and Client,Cliet send information to Server.Whether string array can be sent to Server.In the other hand,Whether object can be sent to Server.
When Server received the information,whether it can be convert to Array,or other object.
海纳百川,有容乃大
壁立千仞,无欲则刚
|
|
|
|
|
Objects have to be serializable (take a look at SerializableAttribute).
Arrays are serializable, if the elements are serializable.
You can send a serializable object/array through a socket by BinaryFormatter.Serialize(). The other side can read it by BinaryFormatter.Deserialize().
|
|
|
|