|
Please send me an e-mail to which I can send the code directly.
Phil
|
|
|
|
|
let say i have a panel, and in that panel i loaded an image:
panel.BackgroundImage = Image.FromFile("image.gif");
Now, i what to make drag & drop with this panel and i want to obtain the name of the image. How can i solve this? When i make the drag & drop operation, can i obtain both the image, and the name of the image? how?
|
|
|
|
|
Hi,
the way I understand it is you can create any object you like, and pass it to
Control.DoDragDrop() when you start dragging, and retrieve it from DragEventArgs.Data
when you handle the drop event, so it is possible to store both a file name and a
bitmap, or anything else you choose.
|
|
|
|
|
i succed to drag & drop the backgroundImage of the panel to another panel, but i want to obtain the name of the image too.
I don't know what is the function which get the name of the image.
panel.BackgroundImage = Image.FromFile("pic.gif");
don't exist a function which take an image parameter and return the name and it's path?
|
|
|
|
|
No, there is no such function.
An image can exist without a file; and different files can contain the same image,
so what should such a function do in these cases ???
|
|
|
|
|
Hi,
I've recently discovered the new report function in Visual C#.NEt 2005. Now I want to create a form that is linked to my database. In my database I've got a table called 'products' and a table called 'categories'. Now I want that my form shows each category with all his products. For example, you've got three categories: amplifiers, speakers, cables. On the report I want to see amplifiers and then al l the products that belong to the category amplifiers then we'll see speakers and then all the products that belong to the category speakers and so on. Can someone help me with this problem? And my report must still be up-to-date, so a change in the db is an change in the report.
Thx.
|
|
|
|
|
in C# Windows Console Application how do i convert number String (for example: "16.3") to Float so that i can do later calculations on? whats the code ?
tx
|
|
|
|
|
float f = Single.Parse("16.3", CultureInfo.InvariantCulture);
---
single minded; short sighted; long gone;
|
|
|
|
|
thanks for your quick efficient help
|
|
|
|
|
You can always use float.parse(variable)
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
I'd prevere double.TryParse method.
This prevents you of an exception if the sring is not a number.
All the best,
Martin
|
|
|
|
|
Which are the differences between .NET 2.0 y .NET 3.0? Is recommended to use .nEt 3.0?
Best regards Borja
|
|
|
|
|
.NET 3.0 is not really a full version update, it's just .NET 2.0 with some added features. Framework 3.0 will not come until .NET 3.5.
If you want to try out the new features, you can install .NET 3.0, but it will not install any new version of the framework if you already have framework 2.0.
---
single minded; short sighted; long gone;
|
|
|
|
|
The .NET 3.0 is basically the same as .NET 2.0 except it also adds WPF, WCF, and Cardspace to the framework (I may be missing a category). .NET 3.0 is part of the foundation of Windows Vista and is not widely used on Windows XP or earlier computers so I would not use .NET 3.0 unless it is absolutely needed or if the target machine is running Windows Vista. In another year or so the .NET 3.0 may become the standard on all computers, but until then use it sparingly.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi, I have many timers in my code also I have Serialport.data.received event, I wana set priority for them.
very tanx
hasi
hasi27
|
|
|
|
|
|
hasi27 wrote: I wana set priority for them.
What do you mean by priority? Simply setting a timer's tick to a lesser value makes it execute more often.
|
|
|
|
|
Hi,
I would say you cant set priority for the normal timer events:
all Windows.Forms.Timers get their event handled by the UI thread, hence at the same priority; it is unclear (I guess unspecified) in which order they would fire assuming
more than one of the timers is supposed to fire at a specific point in time
(maybe you will find my timers article interesting, it tells you more about the
resolution of the timer classes).
all other timers (Windows.Threading.Timer and Windows.Timers.Timer), as well as other
asynchronous events, typically use their own thread to service the event.
Here too, you typically dont control the thread's priority,
and the order of concurrent events is unspecified.
of course, you could organize a periodic event at a higher priority by using
your own thread, set at higher (maybe real-time) priority, and using a high-precision
timer (again see my article).
Hope this helps.
|
|
|
|
|
i have in a textbox "1+2+3". How can i convert this string to find the result aka 6 ?
|
|
|
|
|
"1+2+3" from the textbox is just a string. How to interpret it is entirely up to you. So, in order to obtain the result, you need to write your own parsing rules and calculating logic.
Best,
Jun
|
|
|
|
|
ok! But how could i interpret "+" like + operator ?
I am thinking to split the string "1+2+3", 1,2 and 3 are numbers, integer, but "+" what type it is?
|
|
|
|
|
That type of string can be split to two categories: operands and operators. Operands are simply numbers. With operators, you cast them one by one. Pseudo code may be like this:
switch(operator1)
{
case "+":
result = operand1+operand2;
break;
case "-":
result = operand1-operand2;
break;
}
I am not aware of any shortcuts in this regard.
Best,
Jun
|
|
|
|
|
First you need to split "+" into an array
Then each of the array value needs to be converted or Parsed and added
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
|