|
Hello again Gurus,
How can you tell which row is being selected when the user:
1) Click on the row-header or
2) Click any where or any cell of a row
Thanks Gurus
Khang Nguyen
|
|
|
|
|
hello,
i want to change an html text field's value , programaically.
i am using mshtl object library with web browser control.
now, i have problem in setting the value in a text filed.
can someone help me.
ASIM
Asim
|
|
|
|
|
not sure if this is the sort of thing you want :
VbCode:
<font color="#0000FF">private</font> <font color="blue">void</font> Form1_Load(<font color="blue">object</font> sender, System.EventArgs e) <br> { <br> <font color="#0000FF">object</font> objNull=<font color="#0000FF">null</font>; <br> brWeb.Navigate("about:some text in a browser!", <font color="#0000FF">ref</font> objNull, <font color="#0000FF">ref</font> objNull, <font color="#0000FF">ref</font> objNull, <font color="#0000FF">ref</font> objNull); <br> } <br> <br> <font color="#0000FF">private</font> <font color="blue">void</font> button7_Click(<font color="blue">object</font> sender, System.EventArgs e) <br> { <br> <br> mshtml.IHTMLDocument2 Document; <br> <font color="blue">object</font> source = brWeb.Document; <br> Document =(mshtml.IHTMLDocument2)source; <br> <font color="#0000FF">string</font> s=Document.activeElement.innerHTML; <br> Document.designMode="On"; <br> Document.write(s.Replace("browser", "WEBBROWSER!")); <br> Document.designMode="Off"; <br> } <br>
hope it helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Iam trying to get the pixel of a area in a screen of my program (for collison detection) the API call (GetPixel) seems to work..and it returns a int that i use with Color.FromArgb(int) (i think thats it) anyways when i try to convert the int i get back the color but...it doesnt convert correctly.....the A(alpha) of the color is always 0. Is there something i need to do before i try to convert the int ? Here is the code i use.
<br />
[DllImport("Gdi32.dll")]<br />
private static extern int GetPixel(IntPtr Handler,int x,int y);<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr GetDesktopWindow();<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr GetWindowDC(int Pointer);<br />
[DllImport("user32.dll")]<br />
private static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hdc);<br />
<br />
<br />
int j = CheckPixel(100,100);<br />
int jm =Convert.ToInt32(j);<br />
Color c = Color.FromArgb(jm);<br />
MessageBox.Show(c.ToString());<br />
<br />
<br />
private int CheckPixel(int x,int y)<br />
{<br />
IntPtr DC = GetWindowDC(GetDesktopWindow().ToInt32());<br />
int jm = GetPixel(DC,x,y);<br />
ReleaseDC(GetDesktopWindow(),DC);<br />
return jm;<br />
}<br />
<br />
Thanks for your time.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
Quote from MSDN:
"GetPixel:
The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates. "
This seems to imply that the Alpha value is undefined when returned from GetPixel . It seems as though the Alpha is always zero, but then the docs don't say that so you can't trust it.
I haven't been able to locate how to get the alpha value though
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
hello,
here is the scenario, for my problem.
how can i use IIS installed on another machine in a networked environment, i.e. IIS is not installed on my system.
i am just to create an asp.net application.
ASIM NAZIR
Asim
|
|
|
|
|
If I am understanding what you are asking you need to have FrontPage extensions and ASP.NET installed on the remote machine. However I don't know how firewalling works through this.
Matt Newman Sonork: 100:11179
"Two things have come out of Berkley, Unix and Acid, we do not belive this to be a coincidence" Linux sucks twice as fast and 10 times more reliably, and since you have the source, it's your fault. -Ca1v1n
Post best viewed with lynx
|
|
|
|
|
Hi,
Could anyone tell me how can I add image(icon / jpg...)in subItems of ListView?
e.g. I want to add one icon at Item[1].SubItems[7] ..
what is the way for doing that?
Thanks a lot
|
|
|
|
|
What is the C# equivalent of CMap?
I do not need super lookup speed but fast would be nice. A short example would be very cool, but a hint on what to look up would be perfectly cool.
Thanks
|
|
|
|
|
Try System.Collections.Hashtable
|
|
|
|
|
Dear gurus,
Does anyone know how to set column widths of DataGrid? I only see
dataGrid.ColumnHeadersVisible property.
Thanks in advance,
Khang Nguyen
|
|
|
|
|
Hi
You have to create a tablestyle. Lots of articles on this on the microsoft website.
Thanks
|
|
|
|
|
Thank you very much for the tip. Sorry, I don't know your name.
|
|
|
|
|
Does anyone know of any cases where the baseSerializationType argument to the DesignerSerializationAttribute constructor would be something other than CodeDomSerializer ? For instance anything other than the normal:
[DesignerSerializerAttribute(typeof(Design.ControlCodeDomSerializer), typeof(CodeDomSerializer))]
class Control {
...
Does the Visual Studio design framework allow for other types of serialization? Is that how resources are serialized into .resx files?
I'm curious and it's really just to help me better understand and utilize the designer capabilities of .NET (I'm dabbling on a managed DirectX engine which includes design-time support for 2D-GUI overlays).
Thanks for any info or references (I failed to find any in my searches .
|
|
|
|
|
|
Thanks for the tip. I was using ILDASM which was quite a bit slower than what I was able to do with Reflector. It was pretty easy to find the code in the VS assemblies that called the serializers. Turns out it only calls Serialize on objects of type CodeDomSerializer .
Now if only I can figure out what all of the serivces that DocumentDesigner creates do (the inheritance ones, InheritanceUI and IInheritanceService , have got me befuddled, an idea?).
|
|
|
|
|
Hello everyone.
I planned to migrate some C++ codes into C#. I know some basic syntax of c++, but recently i had huge problems on understanding it and how to convert it in c#?
All together 7 questions. I don't plan to pick up c++ at the moment! Hope you all don't mind helping me. Thanks.
1) Basically there will a header file called: haha.h
haha.h
=======
#ifdef HAHA_EXPORTS
#define HAHA __declspec(dllexport)
#else
#define HAHA __declspec(dllimport)
#endif
extern "C"
{
//some functions
// E.g.
extern HAHA int Unhook();
}
How do you convert such thing into c#? Any idea? Yeah i know that c# don't have header files.
2)
LRESULT CALLBACK MouseProc(int iCode, WPARAM wParam, LPARAM lParam)
{
//...
//...
return CallNextHookEx(hHook, iCode, wParam, lParam);
}
Basically in C#, how do we do callback like in c++? Delegates.. this is what i found from google. Any idea how to convert that callback functions in delegates?
I tried to seach CallNextHookEx(,,,) code in the C++ source code, can't find! There is no such function?
3) Hook and Unhook --> How do we hook and unhook in c#?
Just say, if i am using DirectInput, do i need to hook anymore or Directx can handle everything for me! If i use directx, do i need to store the keyboard or mouse into buffer or something!
4)
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, PVOID pvReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
hInstance = hInst;
return true;
}
Hmm.. is all these being done in c# automatically when i create a new project in vs.net?
5)
#define MAX_NUMBER 100
in C#, we replace const for #define? Can we use other better ways? I heard in C++, they had #define and const too!
6) int (*callback)(char*, char*) = NULL;
How to convert this in c#? I only manage to figure this out,
int (callback - not sure what to place here)(ref char, ref char) = null;
7) In C++, they had these few functions, not sure what is it in c#?
a. MapVirtualKey(key, 0)
b. KBDLLHOOKSTRUCT *keyinfo = (KBDLLHOOKSTRUCT *) lParam; // sounds related to keyboard
c. HC_ACTION
d. LLKHF_INJECTED
e. MSLLHOOKSTRUCT *mouseinfo = (MSLLHOOKSTRUCT *) lParam; // sounds related to mouse
Please help!
Thank you.
Regards,
Chua Wen Ching :p
|
|
|
|
|
Well, See if any of this helps.
1. It depends on what you mean by this question. Do you mean how do I write a function in C#, Or how do I export functions from C#? You can't export functions. You either set a reference to the dll from another .net project or you register it for COM interop and then you can get to it from any language that supports COM.
If you mean the function question then you just have one dec for it. No headers.
<br />
public int MyFunct()<br />
{<br />
return 1;<br />
}<br />
The whole function is declared and programed in one file.
2. Delegates are a little hard to get into in this thread. Many callbacks like you posted arn't needed anymore.
3. Don't know. I do know that direct x 9 has a .net wrapper around all the classes it has. Don't know how good it is as I have never used it.
4. Dll projects do all that for you. Exe projects still have a main function.
5. C# Eliminates #define. They decided it was not worth the headache it caused. Only have const now. The only thing #define is used for in C# is for true/false stuff. Like #define Debug. They you can use #if Debug etc.
6. I'm not sure. What is it used for? Most of the time you don't need anything like that. The framework will do everything for you. What are you trying to do?
7. I don't know what the direct equivalent is, but the framework is HUGE. There is a very very good chance that there is a class in there somewhere that does what you need it to if you can find it.
|
|
|
|
|
Hey Wen Ching,
Trying your luck here at CodeProject?
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
In the Visual Studio.NET, if I set the "Localizable" property of a Form
to true, then I can easily edit each localized Forms. Localizing button
texts, windows captions are easy, but what about strings?
I first tried to add string resources to the form's resx, such as
Form1.en.resx. It worked. However when any control of the form was
updated so the resx file was updated, the string resouce I added
was gone. It seems like VS.NET only allows entries added by itself.
I've searched the internet and found that I should add a new resx
file containing strings only. So I created StringResources.resx,
and StringResources.en.resx and it worked.
But the problem and question is, is this the most effective way?
If I have many forms in my application, should I keep each form's
string resources in a separate file like, Form1StringResources.resx,
Form2StringResources.resx and so on...? It surely looks very painful.
Or keep every form's strings in a single resx file? Then the resx file
gets very large, and strings for unused forms also be loaded at the
same time. Suppose I have 10000 entries in the StringResources.resx,
and current form only uses 100 of them and other 9900 entries are for
forms not used yet, but when I create a resource manager from that file, aren't the other 9900 entries loaded?
Do you have any suggestion? Please advise me.
|
|
|
|
|
Does anyone know how to indicate to the managed compiler that an included DLL should have copyLocal attribute set to false??? Currently I am executing this code:
parameters.ReferencedAssemblies.Add("system.dll");
parameters.ReferencedAssemblies.Add("system.data.dll");
parameters.ReferencedAssemblies.Add("system.xml.dll");
if (linkVersion2XM)
parameters.ReferencedAssemblies.Add
(@"D:\Apps\XM\XMDll.20\xm.dll");
else
parameters.ReferencedAssemblies.Add
(@"D:\Apps\XM\XMDll\xm.dll");
I want to be able to mark the xm.dll assembly as CopyLocal = false !! Is this just an additional part of the assembly string that I add, or is a parameter that I haven't discovered yet???
Any help would be appreciated. Thank you.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
|
Okay, leppie, not so cryptic.
So are you saying that this can only be done in VS and is not an option exposed in the managed compiler?
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
|
Hi There !
I have downloaded the file printtemplates.exe from the VS.Net.
I want to use it, but would like to make some changes.
Does anyone knows how to get the source code ?
Is there another similar open source application ?
|
|
|
|