|
I've never come across Curor.HotSpot[^] before! It's a good one to have. It's not totally clear, but I assume it's the offset from the the top left ( 0, 0 or Point.Empty ) of the control's active cursor rectangle. Using this offset, combined with your line width and mouse position, will give you an accurate drawing point for whatever wierd cursor the user or you may have selected!
|
|
|
|
|
hi, I'am using one mainform and a custom control on it. The custom control consists of some textboxes and a custom progressbar with text.
The mainform properties(for your reference) are: FormBorderStyle=FixedSingle, MinimizeBox=False, MaximizeBox=False
The question is: when I click on other programs(when my mainform is not the active window) and reclick on my mainform, especially the custom progressbar doesn't update its text on it even though the value is updated. All other controls(numericupdown and textboxes) updates properly.
Thanks in advance
|
|
|
|
|
Is your custom control's OnPaint method getting called? If so, try calling CustomProgressBar.Invalidate(); in it.
|
|
|
|
|
yes it is. It works smoothly in general.It only doesn't update its text after making another program's window active and return back to my program again.
Also I already tried Update(), Invalidate() and Refresh() methods of both the mainform, custom control and the custom progress bar separately.
May the reason be the custom progressbar itself?
|
|
|
|
|
It could be. Is your custom progress bar's drawing taking place in an overridden OnPaint? If not, then that's the problem.
|
|
|
|
|
thanks Dave, I checked the source code and there isn't any overriden OnPaint() I will correct it and see if it works.
|
|
|
|
|
Hi to all:
Please could someone help me!
I am new to Silverlight but trying to get my head around the format and structure of it all.
I am experimenting with different ways of designing a web site and encountered the following problem.
What I am trying to do in a nutshell is to host a Silverlight control from a Silverlight application. To be more specific; from a *.Xaml file. My example is below:-
I am using a third party Silverlight control called Vertigo.Slideshow (I'm sure you will have heard of it).
From a website (Html coded page) I just do the following
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Gallery</title>
<script type="text/javascript" src="../Scripts/Release/Silverlight.js"></script>
<script type="text/javascript" src="../Scripts/Release/SlideShow.js"></script>
</head>
<body>
<script type="text/javascript">
new SlideShow.Control(new SlideShow.XmlConfigProvider());
</script>
</body>
I then just add a Data.Xml file (with refs to all images) and also a Configuration.Xml to my current folder. This all works perfectly fine.
However, I've created a new web site in Visual Studio 2008 using 'Silverlight Navigation Application'.
So all my web pages are in the *.Xaml format.
What I'm trying to do is add this Vertigo.Slideshow.Xap control to my web page (Xaml) but really, really struggling. I know I must be doing something fundamentally wrong but cannot seem to resolve it.
I would really appreciate any help whatsoever to anyone who can shed some light on this (or even a snippet of code which will do this).
I would be eternally grateful to whomever gives me a pointer.
Thanks in advance.
Regards
Richard
|
|
|
|
|
Why did you repost this here? You already asked in the correct forum.
only two letters away from being an asset
|
|
|
|
|
HI everyone,
I really need to know how to make compatable with different version of excel application.
I have a application which uses the latest verion excel and it work fine. but when I try to run on any lower version excel it does not work.
thanks in advance.
jashim
|
|
|
|
|
jashimu wrote: I have a application which uses the latest verion excel and it work fine. but when I try to run on any lower version excel it does not work.
Move the version-dependent code to a DLL, and make one for each version of Excel that you wish to support
I are Troll
|
|
|
|
|
Hi Eddy,
I am not sure what are you saying. Can you please give me littile more hints and if possilbe details. I am not an expert yet.
thanks for your help.
Jashim
|
|
|
|
|
Can you separate the importing-code from your application, into a class-library? If so, then you can make a class-library with the appropriate code for each version of Excel.
You're looking for a plug-in system, I guess
I are Troll
|
|
|
|
|
Hi, Eddy Vluggen,
I guess you were right but not 100%. I find a solution to that problem. I am using tow different ways of initiation of excel wb, ws,app.
thanks for yor help.
jashim
|
|
|
|
|
I think you can use the Primary Interop Assemblies for the lowest version of Office your app is going to support and they might work with the newer versions of Office. I haven't tested it, so try it yourself to find out.
|
|
|
|
|
can't figure out a lambada expression that would yield a falttened result of all combinations within the input list of lists
List < List < int > > FindEm(List < List < int > > inputLists) {
var X = ?!?
}
assuming that the input was populated with
List<int> A = new List<int>(new int[] { 1, 2, 3 });
List<int> A = new List<int>(new int[] { 4, 5, 6 });
List<int> A = new List<int>(new int[] { 7, 8, 9 });
List<List<int>> lists = new List<List<int>>( );
lists.Add(A);
lists.Add(B);
lists.Add(C);
the result would look something like
1,4,7
1,4,8
1,4,9
2,4,7
.....
any help or direction would be greatly appriciated
modified on Monday, October 5, 2009 1:35 PM
|
|
|
|
|
cechode wrote: a lambada expression
you'll need quite a swing to pull this one off.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
i've been swingin and missing for a bit now.
now trying to somehow get
among the things i've tried so far
tried to convert this to a self calling kinda thing
var PP = A.Where(x = > x > 0).SelectMany(g = > B.Where(c = > c > 0).Select(c = > new { aa = g, bb = c })).ToList();
but to no avail
then tried to get a bunch of from clauses ( one for each inner list )
var ttt = (from g in A
from c in B
select new { aa = g, bb = c }).ToList();
but also failed
now i figured i'd ask the experts here
|
|
|
|
|
Ok... As a warning, my brain is a little lopsided today... Here's the first weird idea that popped into my head... Partly in pseudocode, and haven't tried it out, but here ya go...
private IEnumerable<List<int>> Test(List<List<int>> data)
{
int numDigits = data.Count;
int lastCount = data[numDigits - 1].Count;
int[] indices = new int[data.Count];
while (indices[numDigits - 1] < lastCount)
{
indices[0]++;
for (int idx = 0; idx < numDigits - 1; idx++)
if (indices[idx] == data[idx].Count)
{
indices[idx] = 0;
indices[idx + 1]++;
}
}
}
Bit of a different angle from what you're trying... Instead of going for recursion, think of it like a series of digits. What this really does is count through the following sequence (Assuming all of your arrays have 3 digits):
000, 100, 200,
010, 110, 210,
020, 120, 220,
001, 101, 201... etc
And it forms results such that, for example, 120 = the second, third, and first digits of the elements, respectively...
Anyway, you get the idea. If you know for a fact that you'll be dealing with 3-digit inner lists, you can simplify this a bit...
|
|
|
|
|
Hi there
We've recently been tasked with creating a setup project for our application. All seems easy enough, but I can't seem to figure out how I can specify the path to the icon files that I'm using in my app. How did I add my icon files? I right-clicked on my solution name while in Visual Studio, then selected "Add New Folder" and I named the new folder "Icons". This adds an "Icons" folder in the same folder where the source files reside (2 folders back from the Debug folder). And then I simply added all my icons in this folder. But now how do I specify this path when creating a setup project? Or do I need to move the icons folder relative to where my EXE resides? (which is the Bin folder).
Any help would be appreciated
|
|
|
|
|
Okay I removed all icons from my application and created a setup project and it then runs fine after installation, so it's definately the icons' path that isn't specified properly. I can copy the Icons folder to the Bin folder which will solve this issue, but how do I then specify this new path?! Because it was simple when using the other way, I could just browse to the Image Source property and select the appropriate icon, but now obviously the icons won't show up in this list anymore because they aren't added as resources.
|
|
|
|
|
I need to move from google search result soap to search result html parser, any help?
private static string CreateMessage(string key, string query, int startIndex, int maxResults, bool safeSearch, bool filter, string country, string language)
{
System.Text.StringBuilder message = new System.Text.StringBuilder();
message.Append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
message.Append("<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">");
message.Append(" <soap:Body>");
message.Append(" <g:doGoogleSearch xmlns:g=\"urn:GoogleSearch\" soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">");
message.Append(" <key xsi:type=\"xsd:string\">" + key + "</key>");
message.Append(" <q xsi:type=\"xsd:string\">" + query + "</q>");
message.Append(" <start xsi:type=\"xsd:int\">" + (startIndex) + "</start>");
message.Append(" <maxResults xsi:type=\"xsd:int\">" + maxResults + "</maxResults>");
message.Append(" <filter xsi:type=\"xsd:boolean\">" +filter.ToString().ToLower()+ "</filter>");
message.Append(" <restrict xsi:type=\"xsd:string\" />");
message.Append(" <safeSearch xsi:type=\"xsd:boolean\">" + safeSearch.ToString().ToLower() + "</safeSearch>");
message.Append(" <restrict xsi:type=\"xsd:string\">lang_" + language + ".country" + country.ToString().ToUpper() + "</restrict>");
message.Append(" <ie xsi:type=\"xsd:string\">latin1</ie>");
message.Append(" <oe xsi:type=\"xsd:string\">latin1</oe>");
message.Append(" </g:doGoogleSearch>");
message.Append(" </soap:Body>");
message.Append("</soap:Envelope>");
return message.ToString();
}
private static GoogleWebSearchResponse DoSearchHelper(string key, string query, int startIndex, int maxResults, bool safeSearch, bool filter, string country, string language)
{
string message = CreateMessage(key, query, startIndex, maxResults, safeSearch, filter, country, language);
WebRequest soapRequest = WebRequest.Create("http://api.google.com/search/beta2");
//WebRequest soapRequest = WebRequest.Create("http://localhost:3833");
soapRequest.Headers.Add("SOAPAction", "urn:GoogleSearchAction");
soapRequest.Method = "POST";
soapRequest.ContentType = "text/xml; charset=utf-8";
using (Stream requestStream = soapRequest.GetRequestStream())
{
using (StreamWriter writer = new StreamWriter(requestStream))
{
writer.Write(message);
}
}
try
{
WebResponse soapResponse = soapRequest.GetResponse();
string responseText = null;
using (Stream responseStream = soapResponse.GetResponseStream())
{
using (StreamReader reader = new StreamReader(responseStream))
{
responseText = reader.ReadToEnd();
}
}
XmlDocument responseDoc = new XmlDocument();
responseDoc.LoadXml(responseText);
GoogleWebSearchResponse response = new GoogleWebSearchResponse(responseDoc);
return response;
}
catch (WebException ex)
{
using (Stream responseStream = ex.Response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(responseStream))
{
string responseText = reader.ReadToEnd();
}
}
//throw ex;
return null;
}
catch (Exception ex)
{
throw ex;
//return null;
}
|
|
|
|
|
Hi
Does anyone know why Excel Crashes at startup
after c# app calls Clipboard.Clear();
even app exits
thanks
|
|
|
|
|
I can clear the clipboard (with Clipboard.Clear) and successfully launch Excel 2007.
I suggest you check your facts.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi Luc Pattyn
Thanks for your info.
I tried 3 machines with vista ultimate sp2 / Excel 2007 all of them fail to launch.
|
|
|
|
|
if your app clears the clipboard and then fails to launch Excel, seems to me you have made some mistake.
Can't help lacking any additional information or code.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|