|
Member 11053420 wrote: @"C:\\"
Use either @ (verbatim string) or escape the backslash, not both. And why concatenate?
string filepath = @"C:\k.xls";
ought to do it.
|
|
|
|
|
Only works if the entire process is 64-bit.
"Didn't work out", what does that mean? Did it throw an exception, did it explode?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello. I have started a process using Process.Start . Now when I resize my panel, I also resize this control. But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. So question is why can not I resize my external program along with panel, just like I resize my panel along with form? Thanks for any pointer.
UPDATE
I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code
private void Form1_SizeChanged(object sender, EventArgs e)
{
SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
}
I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?
This world is going to explode due to international politics, SOON.
modified 19-Sep-14 3:52am.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Edit your question and provide better information.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I have a process that I have started using Process.Start() and placed it on the panel, on my form. Now in order to resize it, I put this code
private void Form1_SizeChanged(object sender, EventArgs e)
{
SetWindowPos(m_hHandle, 0, 0, 0, panel1.Width, panel1.Height, SWP_SHOWWINDOW);
}
I put a breakpoint on this function and noticed that as soon as I resize my form, this breakpoint gets hit. How do I resize this control on my form using Resize or SizeChanged events?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
I note you use the word 'Control to describe what you are working with, but using Process.Start runs an Application that then puts up a window(s).
1. what is the Application you start using Process.Start ?
2. what are you doing to make that Application's Window(s) a child Control of the Panel (added to the Panel's ControlCollection) ? or, is it (more likely), that the application window is not a child of the Panel ?
3. is it possible that whatever application you start's window has a fixed window size maximum ?
4. if you make the Panel size smaller: what happens to the hosted whatever ?
More specific details, please.
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
modified 19-Sep-14 4:56am.
|
|
|
|
|
1 - I am hosting media player classic. I start this application using Process.Start.
2 - Don't know what to say.
3 - NO
4 - nothing
This world is going to explode due to international politics, SOON.
|
|
|
|
|
I'd be interested in the answer to 2. Dark magic, perhaps.
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: I'd be interested in the answer to 2. [^] ? [^] ?
Hi Rob, My understanding is that some applications are designed to be "embeddable" ... like Mozilla, IE. In this case we don't know what app the OP wants to launch, or even if he needs it to be "embedded."
cheers, Bill
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
modified 19-Sep-14 5:13am.
|
|
|
|
|
Interesting. I'll have a look at that later on.
My thinking is its a protected operating system so the idea of borrowing a windows handle from one process and incorporating into the hierarchy in another would be strictly unavailable.
But, as one other comment points out, what about OLE?. More thought/research required.
[Edit] - even if possible somehow, it sounds like a dreadful idea.
Regards,
Rob Philpott.
|
|
|
|
|
AmbiguousName wrote: But the problem is, it stops resizing after I drag its border just a little bit. It does, though, resize for that little bit drag of form border. That is a bit confusing, does it resize or does it not? Is this window a child of your panel (i.e. how are you hosting it) or are you just positioning it above your panel?
|
|
|
|
|
Please read my updated question. As I said there, breakpoint gets hit which means that I can not go on and continue resizing my form.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
AmbiguousName wrote: breakpoint gets hit which means that I can not go on and continue resizing my form. That is as to be expected, but does not add to the information you have been asked to provide.
|
|
|
|
|
First, that other process is not a "control". It's a foreign process "window". You cannot use the two terms interchangeably as this will confuse people.
Second, I already told you what you're doing is very difficult to control and you will not have complete control over the foreign process window. Users CAN and WILL manipulate that window just like it was sitting on the Desktop outside of your application. For example, they WILL be able to grab the window title bar and window edges and move them around. They can even minimize and maximize the window without your application knowing anything about it!
What you're doing is possible to do, but not in a production application. It's more of a novelty than anything else.
|
|
|
|
|
Now that we finally know you are using the Win Media Player ... check out: [^].
cheers, Bill
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
|
|
|
|
|
hi,
i'm implementing one program in C#.net Console application for converting pcl files into pdf format using GhostScript open source dll.
could you please tell me how to implement the above task using mentioned dll, if anyone knows?
if possible, please send the source code which is properly working.
thank you,
sai k
|
|
|
|
|
GhostScript cannot read/convert pcl files: you need to use PCL (note that even GhostScript's site sometimes using PDL); it's part of the GhostScript "family"), see: [^].
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
modified 19-Sep-14 5:00am.
|
|
|
|
|
Hi,
I had the following code to Post my data to WebApi.
[code]
public EFileInfo UploadFile(string WebApiBaseAddress, string WebApiServiceUrl, WebApiParameters webParams)
{
EFileInfo eFile = null;
RestClient client = new RestClient(WebApiBaseAddress);
RestRequest request = new RestRequest(WebApiServiceUrl, Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddBody(webParams);
IRestResponse response = client.Execute(request);
eFile = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<efileinfo>(response.Content);
return eFile;
}
[/code]
And the following is my code to accept the parameter and post the data:
[code]
public EFileInfo PosteFile(WebApiParameters wParams) {
EFileInfo eFileResult = null;
var httpRequest = HttpContext.Current.Request;
try {
eFileResult = resp.Upload_File(AppRootPath, Convert.ToInt32(wParams.Parameters["year"]),
Convert.ToInt32(wParams.Parameters["month"]), wParams.Parameters["location"],
wParams.Parameters["brand"], wParams.Parameters["department"], wParams.Parameters["type"],
wParams.Parameters["generateFrom"], Convert.ToInt32(wParams.Parameters["expiryDuration"]),
wParams.UploadFiles.First());
} catch (InvalidOperationException ex) {
throw new NotImplementedException(ex.Message, new Exception(ex.InnerException.ToString()));
// throw new NotImplementedException(ex.Message, new Exception(ex.InnerException.ToString()));
}
return eFileResult;
[/code]
I am not sure why the parameter always unable to pass it to PosteFile. The process sometimes run smoothly but sometimes it pass NULL value to PosteFile function. I checked the parameters, everything is ok.
|
|
|
|
|
Not much information there. But why do you think there is a problem? Easiest solution of course is if wParams is null then check at the beginning of method and exit the method without doing anything.
|
|
|
|
|
hellow to every body
i have a little froblem with this question. i want to get an information from a website with c# and save to my database.i can get the website but i cant choose a part that what i want.the information that i want to save in my db is a table from a website.
i write the coosen code here . please give me a code that i can choose this part and save it in my db.
thank you All.
1393/07/04نرخ رسمي ارزيك دلار آمريكا26635يك يورو34496يك پوند انگليس43337يكصد ين ژاپن24847يك فرانك سويس28549يك دلار كانادا24266يك دلار استراليا24157يك كرون نروژ4160يك كرون سوئد3738يك كرون دانمارك4633يك درهم امارات متحده عربي7252يك ريال عربستان سعودي7102يك دينار كويت92677يك دينار بحرين70631يك ريال قطر7314يك ريال عمان69164يك روپيه هندوستان437يك لير تركيه12079يكصد دينار عراق2293يك راند آفريقاي جنوبي2442يوان چين4335رين گيت مالزي8280دلار سنگاپور21114دلار هنگ كنگ3437هزارروپيه اندونزي2235هزار وون كره جنوبي25775يكصد درام ارمنستان6515يك منات آذربايجان33961يك روبل روسيه695يك دلار تايوان885يك ريونيا اكراين2050يك هزار روبل بلاروس2534يكصد بات تايلند82684
and this is that code
<span style="direction:ltr" dir="ltr">1393/07/04</span></td></tr><tr><td class="auto-style2" style="color:white;background-color:green" colspan="2">نرخ رسمي ارز</td></tr><tr><td class="ms-list7-odd">يك دلار آمريكا</td><td class="ms-list7-odd">26635</td></tr><tr><td class="ms-list7-even">يك يورو</td><td class="ms-list7-even">34496</td></tr><tr><td class="ms-list7-odd">يك پوند انگليس</td><td class="ms-list7-odd">43337</td></tr><tr><td class="ms-list7-even">يكصد ين ژاپن</td><td class="ms-list7-even">24847</td></tr><tr><td class="ms-list7-odd">يك فرانك سويس</td><td class="ms-list7-odd">28549</td></tr><tr><td class="ms-list7-even">يك دلار كانادا</td><td class="ms-list7-even">24266</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يك دلار استراليا</td><td class="ms-list7-odd" style="height: 23px">24157</td></tr><tr><td class="ms-list7-even">يك كرون نروژ</td><td class="ms-list7-even">4160</td></tr><tr><td class="ms-list7-odd">يك كرون سوئد</td><td class="ms-list7-odd">3738</td></tr><tr><td class="ms-list7-even">يك كرون دانمارك</td><td class="ms-list7-even">4633</td></tr><tr><td class="ms-list7-odd">يك درهم امارات متحده عربي</td><td class="ms-list7-odd">7252</td></tr><tr><td class="ms-list7-even">يك ريال عربستان سعودي</td><td class="ms-list7-even">7102</td></tr><tr><td class="ms-list7-odd">يك دينار كويت</td><td class="ms-list7-odd">92677</td></tr><tr><td class="ms-list7-even">يك دينار بحرين</td><td class="ms-list7-even">70631</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يك ريال قطر</td><td class="ms-list7-odd" style="height: 23px">7314</td></tr><tr><td class="ms-list7-even">يك ريال عمان</td><td class="ms-list7-even">69164</td></tr><tr><td class="ms-list7-odd">يك روپيه هندوستان</td><td class="ms-list7-odd">437</td></tr><tr><td class="ms-list7-even" style="height: 23px">يك لير تركيه</td><td class="ms-list7-even" style="height: 23px">12079</td></tr><tr><td class="ms-list7-odd">يكصد دينار عراق</td><td class="ms-list7-odd">2293</td></tr><tr><td class="ms-list7-even">يك راند آفريقاي جنوبي</td><td class="ms-list7-even">2442</td></tr><tr><td class="ms-list7-odd">يوان چين</td><td class="ms-list7-odd">4335</td></tr><tr><td class="ms-list7-even">رين گيت مالزي</td><td class="ms-list7-even">8280</td></tr><tr><td class="ms-list7-odd" style="height: 23px">دلار سنگاپور</td><td class="ms-list7-odd" style="height: 23px">21114</td></tr><tr><td class="ms-list7-even">دلار هنگ كنگ</td><td class="ms-list7-even">3437</td></tr><tr><td class="ms-list7-odd" style="height: 23px">هزارروپيه اندونزي</td><td class="ms-list7-odd" style="height: 23px">2235</td></tr><tr><td class="ms-list7-even">هزار وون كره جنوبي</td><td class="ms-list7-even">25775</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يكصد درام ارمنستان</td><td class="ms-list7-odd" style="height: 23px">6515</td></tr><tr><td class="ms-list7-even" style="height: 23px">يك منات آذربايجان</td><td class="ms-list7-even" style="height: 23px">33961</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يك روبل روسيه</td><td class="ms-list7-odd" style="height: 23px">695</td></tr><tr><td class="ms-list7-even" style="height: 23px">يك دلار تايوان</td><td class="ms-list7-even" style="height: 23px">885</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يك ريونيا اكراين</td><td class="ms-list7-odd" style="height: 23px">2050</td></tr><tr><td class="ms-list7-even" style="height: 23px">يك هزار روبل بلاروس</td><td class="ms-list7-even" style="height: 23px">2534</td></tr><tr><td class="ms-list7-odd" style="height: 23px">يكصد بات تايلند</td><td class="ms-list7-odd" style="height: 23px">82684</td></tr></table>
|
|
|
|
|
First, nobody is going to write your code for you. The code you get is the code YOU write.
Second, you haven't said anything at all about what you what out of that table.
|
|
|
|
|
And Please format your code
Please up vote if it helped you
Thanks And Regards
Sibeesh
|
|
|
|
|
can we programmatically detect when user touch the panel left or right edge ? suppose i have one panel with 200X200 size now i want to update a label text when user place his mouse at the left or right most portion on the panel. anyone can help me to achieve it programmatically. thanks
tbhattacharjee
|
|
|
|
|
There's a mousemove event, and there's a mouseenter event on each control.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I assume this is a Windows Forms project with: on the same Form:
1. a Panel named 'panel1 200x200 in size
2. a Label named 'label1
3. you define the Panel's 'MouseMove EventHandler:
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (e.X < 5 || e.X > 195)
{
label1.Text = e.Location.ToString();
}
else
{
label1.Text = "";
}
} The label will be updated with the current mouse position in 'panel1 co-ordinates every time it is moved within 5 points of the right and left side.
Consider another simple solution:
1. a Panel, 'panel1 200x200
2. a Panel, 'panel2 190x200
3. a Label, 'label1
by placing 'panel2 inside 'panel1 (adding 'panel2 to panel1's ControlCollection), and writing this MouseMove EventHandler for 'panel1:
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
label1.Text = e.Location.ToString();
} The mouse-move will be detected only when the mouse is over the area not covered by 'panel2: which would be an area of the two horizontal sides of 'panel1 5 points in width.
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
|
|
|
|