|
Then you need to look at the KeyPressed event
<a TITLE="See my user info" href=http:
|
|
|
|
|
|
Zachery wrote:
I read about using SafeNativeMethods.TrackPopupMenuEx(), but VS says it's inaccesable due to its protection level. Any ideas?
Use Reflection to get the MethodInfo and invoke it from there.
<a TITLE="See my user info" href=http:
|
|
|
|
|
|
not that easy
something like this would work
static MethodInfo trkpmnu = null;
...
Assembly ass = Assembly.Load(filename);
foreach (Type t in ass.GetTypes())
{
if (t.Name == "SafeNativeMethods")
{
trkpmnu = t.GetMethod("TrackPopupMenuEx",
BindingFlags.Static | BindingFlags.NonPublic);
break;
}
}
...
object result = trkpmnu.Invoke(null, args[]);
<a TITLE="See my user info" href=http:
|
|
|
|
|
Is it possible to run JavaScript from a windows form?
If so, how do I do it? Maybe I'm missing something, but I haven't found an easy way to do it.
If not, is there an easy way to manipulate IE using .Net?
I'm trying to interface to an online component that is written in JavaScript using a windows form. The JavaScript calls return info about a video server and I need to get the info for the windows app.
Thanks
~ D
|
|
|
|
|
I'm not sure what is wrong with my setup but I can't generate a dataset class of the following schema
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema id="dccollection" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://diglib.auburn.edu/schemas/dccollection/"
targetNamespace="http://diglib.auburn.edu/schemas/dccollection/"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd" />
<xs:element name="record" type="dc:elementContainer" />
<xs:element name="dccollection">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="record"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
I always get a error CS0542: 'dccollection': member names cannot be the same as their enclosing types
Can anyone else build a typed dataset without compile errors of this schema?
|
|
|
|
|
Jarrett Vance wrote:
I always get a error CS0542: 'dccollection':
Either rename the container or the element....
<a TITLE="See my user info" href=http:
|
|
|
|
|
i am using a mouse move message handler which is passing in System.Windows.Forms.MouseEventArgs e .. the problem is that e.X and e.Y are both relative to the current control which is calling the message handler..
how can i get the mouse position relative to the entire screen, not the control thats calling it? something like clienttorect or something?
thanks!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
See Control.PointToClient and Control.PointToScreen (there's also variants of those for Rectange s).
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Hello All,
Im actually looking for some general suggestions. I am suppose to edit a datagrid control that has been prepopulated. When I say prepopulated, I mean that we use this third party tool that binds to the datagrid. Here are my problems:
1. Is it possible to get a collection of the column objects at runtime?
2. Can I reorded the columns at runtime?
3. Can I rename the column headings?
It looks like all of these things are fairly simple to do, through the DataGrid.TableStyles object. But I really don't have much to work with other than the grid, because of the binding to the third party control. I guess if someone could direct me on how I can get and edit the columns collection of the datagrid I would be greatly appreciative.
Thanks,
Ryan
|
|
|
|
|
for questions see System.Windows.Forms.DataGridTableStyle and DataGridColumnStyle, this two things are grid properties so you don't have to knoe the source (if the source edit TableStyles then you are in trouble)
if you don't have the Datatable to which the grid is binded you don't have any direct way to find the columns.
From Greece:
Dimitris Iliopoulos
dimilio@yahoo.com
|
|
|
|
|
This is probably an easy thing to do, but I can't figure out the syntax to save my life.
I'm clicking a button on FormRed to launch a Dialog that will enter a new number to be added to a combobox on Form Red. I can Add it to the database from that launched Dialog, but when it closes, I can't get the parent Form Red to refresh, it appears if I close and re-open it though.
What kind of syntax am I missing to make this work?
Thanks!
private void buttNew_Click(object sender, System.EventArgs e)
{
frmCreateProblemReport cpr = new frmCreateProblemReport(this.conns);
cpr.ShowDialog();
cmbPRNumber.Refresh();
}
|
|
|
|
|
once you come back from the dialog you need to call whatever function you have which populates your combobox with values from your database..
something like:
private void buttNew_Click(object sender, System.EventArgs e)
{
frmCreateProblemReport cpr = new frmCreateProblemReport(this.conns);
if (cpr.ShowDialog() == DialogResult.OK)
PopulateComboBox();
}
just make sure that since you are populating the combobox multiple times that the PopulateComboBox() function begins with:
cmbPRNumber.Items.Clear()
just because you call a dialog and you know what you want it to do with the data entered doesnt mean your other form will instantly reload everything.. you have to tell it to.. hope that helps..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
ROCK.
Thanks dz, that was it. Piece of cake.
|
|
|
|
|
Sorry if this seems like too simple of a question for most people but . . .
I have a project with multiple classes and when I go to add that projects DLL to the tool box (so that it can be used in another project) its adds all the classes/controls in that DLL which is not necessarily what I want. I know that there is a way to set whether a class is visible in the tool box or not but I just can't seem to find the proper syntax anywhere. I know its something like:
<br />
[System.ToolBox.Visible = false]<br />
public class MyClass : System.Windows.Forms.Controls<br />
{<br />
public MyClass()<br />
{<br />
}<br />
}<br />
Any help you could give me would be truly appreciated.
Cheers
Mike
|
|
|
|
|
In MFC/C++, the function TrackPopupMenu() allows you to position the menu ( Right/Left/Centered ) with respect to the right mouse click position.
Whereas the ContextMenu.Show doesnt have any such option. If anyone knows how to do this stuff in C#, please send me the details?
VenkataSundaram
Bangalore
|
|
|
|
|
Hi Venkat,
Try using
public static bool TrackPopupMenuEx(HandleRef hmenu, int fuFlags, int x, int y, HandleRef hwnd, TPMPARAMS tpm);
this is found in Windows.Forms.SafeNativeMethods, but this thing is not documented.
However you can try achieving the same through interop.
Cheers,
Kannan
|
|
|
|
|
I found a lot of things about calling applications and Documents from C# very simple. But I did not find documentations about Calling simple DOS Commands line "md NewDire" or "Copy *.* to x:" from C#.
So I would be happy if somebody could tell me how I can use simple DOS Commands from C#.
I need the following commands: md, copy *.prg
Thanks
Stefan
|
|
|
|
|
Have you tried Process.Start with "Cmd.exe /C CommandToRun"?
Why not just use the .NET file management for these such as "File.Copy" or "Directoy.CreateDirectory"?
Rocky Moore <><
|
|
|
|
|
Thank you! You answered exactly what I wanted.
Process Start Cmd.exe : Did not see this solution.
File.Copy, Directory.Create : simple, I just did not find it in the help doc.
Thank you!
Stefan
|
|
|
|
|
How can I colour (and set boldness and such things) individual charaters in a RichTextBox?
I did this back in VB6 using the SelectionX parameters (they changed the text under selection, not the selection itself as it does in C#), but I can't find anything to do the same thing in C#.
|
|
|
|
|
here ya go this should get you started off :
VB:
<font color="blue">Private</font> void button4_Click(<font color="blue">Object</font> sender, System.EventArgs e)
{
richTextBox1.SelectionStart=richTextBox1.Text.Length;
richTextBox1.SelectionColor=Color.Blue;
richTextBox1.SelectionFont=new Font("Tahoma",10,FontStyle.Bold);
richTextBox1.SelectedText="testing blue bold\n";
<font color="DarkGreen">
richTextBox1.SelectionStart=richTextBox1.Text.Length;
richTextBox1.SelectionColor=Color.Red;
richTextBox1.SelectionFont=new Font("Verdana",10,FontStyle.Regular);
richTextBox1.SelectedText="now testing in red\n";
}
hope that helps a little
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
Thanks! Exactly what I needed
|
|
|
|
|
For example,when mouse moves over the webbrowser's client area,a MouseOver event will be fired.
Thanks,a lot.;)
|
|
|
|