|
cool:in C# you can do
System.Diagnostics.Process.Start(openFileDialog1.FileName);
not sure if it answers your question fully but that's my .02....
:->
|
|
|
|
|
You don't need API to do that.
If the file and the application in the machine, you just need this:
<br />
System.Diagnostics.Process p=new System.Diagnostics.Process();<br />
p.StartInfo.FileName="C:\\a.jpg";<br />
p.Start(); <br />
<br />
I hope that's you need to.
|
|
|
|
|
Well the real problem is i hv a listview in which files of all types (media, doc, txt etc.) are listed , i want to open each of them in their corresponding application by double clickin on them.i want to use some API in the click event of the listview that wud search for the executable of that file by looking at its extension.
how do i do that? ur solution has open dialog box which is not there in the scene....
|
|
|
|
|
Well the real problem is i hv a listview in which files of all types (media, doc, txt etc.) are listed , i want to open each of them in their corresponding application by double clickin on them.i want to use some API in the click event of the listview that wud search for the executable of that file by looking at its extension.
how do i do that? ur solution has open dialog box which is not there in the scene....
|
|
|
|
|
Hi
I am trying to find out in registry when i was connected Two computer thr modem and phone lines. I am unable to find in registry however i am able to find in registry settting LAN network setting.
I have to find out the DIal up connection's name in Registry,
How could i find out the dial up connection's name in registry.
Actucally i have the program which displays local network Lan connetion in list box. I have to display also dial up connection in List Box.
I have the program for displaying Local Area connetion.When i connects thr dial up my program gets hanged
can anyone help me
regards
sanjeev
|
|
|
|
|
OK, here's the problem: I have a borderless form (it's Form Border Style property is set to "None"), but I can't figure out how to move it when the user drags on my custom Title Bar. I don't want to go back to square one and change the Form Border Style, I just want to figure out how to move the form when user drags the top.
I can make a transparent panel on top of the form and register mousdown and set a boolean, movingMe, to true, if this panel receives the mouseUp event or the mouseLeave event I set the movingMe bool to false. then on mouseMove if movingMe is true I do this:
NOTE: lastX and lastY are defined as global integers. on mousedown I set them to the mouse's X and Y.
in this case, e is a mouseEventArg
if(movingMe)
{
int dX, dY;
dX=e.X-lastX;
dY=e.Y-lastY;
if(dX != 0 || dY != 0)
{
this.Location=new Point(this.Location.X+dX, this.Location.Y+dY);
this.Refresh();
lastX=e.X;
lastY=e.Y;
}
}
but that doesn't work properly, i get screen flicker and only "almost" moves to where it should. I can live with a little flicker, but it needs to keep up with the mouse (i.e. if the title bar should remain under the mouse). I know some of you can put some input into this, and I know this has been discussed a little bit already, but no one's really answered this question. Little help please?
Frustrated,
Wes Lund
|
|
|
|
|
Wes, you have to use a fixed coordinate system because the form's coordinate keeps changing as it moves, so you should use the Screen coordinates.
Here is the code: (Try using entire form instead of panel to see if painting still works fine)
<br />
private Point lastPos, offset;<br />
private bool movingMe;<br />
<br />
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
Size zeroCoordinate = (Size)PointToScreen(new Point(-2,-30));<br />
Point mousePos = PointToScreen(new Point(e.X, e.Y));<br />
offset = mousePos - zeroCoordinate;<br />
movingMe = true;<br />
}<br />
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if(movingMe)<br />
{<br />
int dX, dY;<br />
Point mousePos = PointToScreen(new Point(e.X, e.Y));<br />
dX=mousePos.X - lastPos.X;<br />
dY=mousePos.Y - lastPos.Y;<br />
if(dX != 0 || dY != 0)<br />
{<br />
this.Location = mousePos - (Size)offset;<br />
this.Refresh();<br />
lastPos = mousePos;<br />
}<br />
}<br />
<br />
}<br />
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
movingMe = false;<br />
}<br />
<br />
This was an interesting problem, please let me know of any additional updates you make so I can add your changes to my code snippets.
|
|
|
|
|
There's the WM_NCHITTEST message. That's what it's for.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hi guys
Can any body explain what is this below
please only who knows and serious to reply
--------------------------------
background1_files dlg1n none 50200 -1
background2_files none none -1 -1
background3_files none none -1 -1
palette_file pal1 50501
cursor_file cursor1 51001
shade_amount percent 54
button_file none -1
popup_dialog_sin dlg1 50001
background_position 2
background_color 156
bevel_colors 228 224 193 199 155 90
text_color1 217 208 176
text_color2 0 0 0
focus_color1 202 207 1
focus_color2 0 0 0
state_color1 255 255 255
state_color2 0 0 0
After all, Today is the Tomorrow you worried about Yesterday
|
|
|
|
|
I'll bite!! A text file with a bunch of information in it????
Or, it would appear that someone is saving control property information into a text file to be loaded the next time the application is run.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Its an alien code and it says we are all going to die tomorrow!!!
Serious enough?
|
|
|
|
|
its the beginning of the matrix...
|
|
|
|
|
It's a rash....awe crap wrong board again!
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi ,
I have a table (tblSql, a primary key included) stored in Sql Server which has the same infomation as the table (tblVFP, no primary key) in VFP. Can anybody tell me what is the simplest way to update infomatioin in tblVFP when information in tblSQL changes?
A friend has ever told me to update VFP table with ds_SQL with the following code:
DataSet ds_VFP=ds_SQL.Copy();
da_SQL.Update(ds_SQL);
da_VFP.Update(ds_VFP);
I tried, but get the following error information:
Update requires a valid update command when passed DataRow Collection with Modified rows.
My friend told me he didnot write any update command by himself in his program. But I just cannot work it out, what is wrong here?
Thanks...
|
|
|
|
|
|
Hi,
Not sure where to post this...
I'm busy converting an old VB 6 app ( ) to .NET and I'm having a little issue with crystal. In the VB 6 code, when you export a report to disk, it used to pop up a dialog box that showed you how far, percentage wise, it was in the export. I've converted this to .NET and it exports perfectly BUT it doesn't pop up that little crystal dialog box to show how far the export is...
Anyone have any ideas on this? I've looked for methods and properties in the ReportDocument and ExportOptions classes but couldn't see anything.
Thanks!
Nick
The man who smiles when things go wrong has thought of someone he can blame it on.
If you tell a man there are 300 billion stars in the universe, he'll believe you. But if you tell him a bench has just been painted, he'll have to touch it to be sure.
|
|
|
|
|
Dear All,
I have an EventInfo object of an event. I want to know the parameters type of the event Handler function.
for example, EventHandler is the event parameters of event handler is object and EventArgs.
please help me regarding this.
regards,
Mohamed Hasan.
Contact him at: hasansheik@hotmail.com
hasansheik@yahoo.co.in
hasansheik@lycos.com
|
|
|
|
|
Get the Type object for the delegate behind the event and get the parameters of the Invoke method. Something like
EventInfo []events = ktfaType.GetEvents();
for(int i = 0; i<events.Length; ++i)
{
MethodInfo methodInfoType = events[i].EventHandlerType.GetMethod("Invoke");
ParameterInfo []parameters = methodInfoType.GetParameters();
for (int j = 0; j<parameters.Length; ++j)
{
Console.WriteLine(paramaters[j].ParameterType + " " + parameters[j].Name);
}
}
This code relies on the fact that every delegate has an Invoke method which is automatically generated by the compiler depending on the type of delegate's declaration.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi I trying to use web services which works fine as long as I have a working internet connection and the service is running. If my connection goes down then it takes a very long time for the service to time out. Is there any good WebPages about best practices regarding web services when working offline?
|
|
|
|
|
hi
I am implementing Windows application.
When i access the network through my program i am getting Access denied exception
pls check the message given below
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
Additional information: Access is denied.
regards
sanjeev
|
|
|
|
|
This is nowhere near enough information to diagnose your problem.
Your code is either running from a network share, in which case, it'll be running in a more security-restricted sandbox, or your code is trying to do something where the user doesn't have sufficient rights to whatever resources your trying to get at.
Without knowing more about your code, the failing code snippet would help GREATLY!, and the environment it's running in, it's impossible to tell what's going on.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a windows application and in a form page are a datagrid and 2 labels.
I want to print them but I printed the label over the datagrid.
Can somebody to help me.
<<<<
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(230, 0), this.Size));
this.InvokePaint(grdExpenseSheet, myPaintArgs);
myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(500, 300), this.Size));
this.InvokePaint(lbTSEmployeeContent, myPaintArgs);
}
>>>>>
|
|
|
|
|
How do you map TimeStamp (SQL Server) to DateTime (.NET) datatype? I ran into the following error:
"Could not cast the value in field ts_times4_ to the Type TimestampType. Please check to make sure that the mapping is correct and that your DataProvider supports this Data Type."
My table:
CREATE TABLE [some_table] (
[field1] [int] NOT NULL ,
... other fields ...
[ts_timestamp] [timestamp] NULL ,
.... other fields ...
) ON [PRIMARY]
My class:
Namespace ....
Public Class AtDivision
... other properties ...
Protected _timestamp As DateTime
' How do I map to data type 'Timestamp'?
Public Property Timestamp() As DateTime
....
End Property
End Class
I tried this in my mapping file, but, ran into the error I mentioned...
property name="Timestamp" column= "ts_timestamp" type="Timestamp"
Thanks in advance!
Norman Fung
|
|
|
|
|
Not sure about how nHibernate handles this, but a SQL timestamp is a .NET byte array.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "Most of us are programmers, but a few use VB", Christian Graus
|
|
|
|
|
I'm having a VERY hard time finding material I can read to understand this stuff. So far I got a program to evaluate mathematical equations and a basic Lexer that splits a string simply into a stack like so...
Example string - FunctionName ( "Param1" );
Stack[5]SEMICOLON
Stack[4]CLOSE_PAREN
Stack[3]"Param1"
Stack[2]OPEN_PAREN
Stack[1]FunctionName
Basically it tells me when it hits a special character, and after that it tells me what's inside it. I'm having a really hard time explaining this, a bunch of source is available here:
www.insolence9.com/downloads/SBN.zip
Thanks
|
|
|
|