|
I have a question which I am sure someone has had before me:
when implementing drag'n'drop for a treeview control I have no problem, except that when dragging over an area in the treeview control which is empty (lets say i have only three nodes, but the control is much higher than this), The drop operation is not allowed, only when dragging onto previous nodes. Why is that? Can I do something about it in an easy way?
thankful for help,
Bjørn
|
|
|
|
|
Hello,
i have read on msdn the documentation referring to DPAPI. i have also tried those examples and when i have reached the user store problem i have noticed that there is an access conflict on DataProtector constructor (when i try to initalize an DataProtector object) so firstly i set the COM+ DPAPI Helper Application to run as a service (as in msdn's example) and it didn't work. secondly i set the COM+ application to run as library and it worked . my little question is what should i do to make DPAPI work in user store problem
Thanks, claudia
|
|
|
|
|
In vb.net when i declare a variable as object type then i can set any property for that object that is not assigned at design time but but will be assigned at runtime. for example:
dim a as object
if typeof a is textbox then
a.name="test1"
end if
The above code will not give any error at design time in vb.NET but in C# it will give an error during design time only - "'object' does not contain a definition for 'name'".
Please help me,how do i solve this problem.
Thanks in advance
Sheel
Sheel Gohe
|
|
|
|
|
The following should work:
if (typeof(a) is TextBox)
{
((TextBox) a).name="test1";
}
www.troschuetz.de
|
|
|
|
|
Thanks Stefan.
Sheel Gohe
|
|
|
|
|
Actually the codes should be:
object a = new object();
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
Or:
object a = new object();
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
|
|
|
|
|
Actually, your code is just as incorrect.
LdqxYY wrote:
object a = new object();
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
If a has been instantiated as an object, then the line
if(a is textBox)
will always evaluate false
then in your second example:
LdqxYY wrote:
object a = new object();
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
you are testing to see whether an instance of System.Type is-a TextBox - which it clearly isnt it is System.Type!
To correct these two examples assume that there is a TextBox on the form with the instance name myTextBox. Now assume that you have a variable named myVar which is of type object, but is set to myTextBox
if(myVar is TextBox)
{
((TextBox)myVar).Text = "Hello World";
}
or in the second example above
if(myVar.GetType() == typeof(TextBox))
{
((TextBox)myVar).Text = "Hello World";
}
|
|
|
|
|
J4amieC,you are right!And I had realized my second example were incorrect after submitted.By the way,what exact mean in my first example is:
object a = new object();
//
//some codes handle with the "a"
//
if( a.GetType() is TextBox )
{
((TextBox) a).Name = "test1";
}
I forgot writing something,hehe...
Thanks again!
|
|
|
|
|
God!Wrong again,sorry!It should be:
object a = new object();
//
//some codes handle with the "a"
//
if( a is TextBox )
{
((TextBox) a).Name = "test1";
}
|
|
|
|
|
LdqxYY wrote:
were incorrect after submitted
That's why we have a Modify button
|
|
|
|
|
How to make crystal report with utf-8 (my database is SQL 2000 and data was stored in UTF-8)
thanks,
|
|
|
|
|
Ok guys, i not even know if it's a problem but i've seen many c# tutorials that explain assembly compilation by command line and i've seen they usually use "csc (my arguments...)".
That "csc" is a bit strange for me because they only use csc directly("c:\>csc myarguments..." for example) but i have to type all the path to the csc.exe file (C:\Windows\Microsoft.NET...csc.exe Myarguments...).
How can i create a link to csc?
Thanks in advance
Heinz Suez
|
|
|
|
|
Add it's path to your path variable or copy it to a path that is there already, such as system32.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Hi All,
I have a custom datagrid with two checkbox controls in it.
When checkboxA is checked then if checkboxB is checked, it is unchecked and vice versa. (not like a radio button since if checkboxA is unchecked then nothing happens to checkboxB).
But I would like to implement this in client side...any help would be GREATLY appreciated!
schoudhr@hotmail.com
|
|
|
|
|
Then you need the variable names in the html, and to write some javascript.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yes, i know that
the question is how
|
|
|
|
|
Hi,
for that, you have to use javascript. First you can search a control with getElementID from javascript and then you can enable and disabled at client side.
All the best
Anil Joshi
|
|
|
|
|
I know how to do that already...
its a pretty generic process
the question is mainly how to access an elementID from a serverside datagrid
|
|
|
|
|
dgap wrote:
the question is mainly how to access an elementID from a serverside datagrid
Like I said, look at the resultant HTML. You can catch events like onitemdatabound to set the IDs if they aren't being set for you as you would like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
HI All, I want to write a "Send To" menu class using C#(it's function just like the "Send To" Menu in the windows OS,send files to a specified target,such as desktop,MyDocument,Mail Recipient etc.), and I've finished it ,but there is still some problems .I use COM code (use IShellFolder,IDropTarget etc.) to do this work, this is too complex I think, so I want to know are there any simple ways to do it?
There is another problem , I add the "Send To" menu items in the System's Send To folder , in win2000 ,all the "Send To" menu items are in this folder ,but in win_xp there are some items not in the system's Send To folder (such as floppy disk,DVD RW Drive),but they appears in system's send to menu. I just want to know does Windows puts “Removeable Drives” in the Send To menu automatically?
some one told me that:"While trying to fiddle around with the various places where SendTo entries can come from I guess it'd be faster to learn about the COM interfaces that should give you all SendTo targets, regardless of whether they are links in certain directories, registry entries or anything else."
But,which COM interface should I use to get all Send To targets?Please give me some useful information .Many Thanks!
|
|
|
|
|
I have a device using M-Jpeg,i can catch jpeg data at client,
but it's jpge cannot Decoder ,it like that:Bmp bmp = new (JpegData)
there will throw a GDIPlus Error ,I dont know why ,but these jpeg files
can renderred by GDI,so i think if it's a bug of GDIPlus.Could somebody
met these kind problem?Jpeg can decoder by GDI but cannot decode
by GDIPlust.It's confused me for a long time.
|
|
|
|
|
1. GDI has no method of handling a JPEG. Not one.
2. If you tell us what the error is, it would help us to help you
3. What is JpegData ? That is, what is the type of this variable ?
4. Always assume the library has a bug only when you are totally certain your code is calling it correctly, and even then, take care. It's always best to assume the bug is yours, otherwise, it will go unfixed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, thanks for your words,and i know your meaning
maybe my description is not in detail.
Our company using m-jpeg tech to transform jpeg data from Remote device to
client.When i access a standard uri i will get the stream like that:
socket.connect,then i get the stream,
/*
--MYBOUNDARY Content-Type: image/jpeg Content_Length: 3926 Trigger_Flag: 0 ÿØÿçÿÛC ,6') ,@9DC?9>=GPfWGKaM=>YyZaimrsrEU}|ofprnÿÛC4
*/
I use socket to connect the device then get the stream,get the JPEG data
from stream(using jpeg label :ffd8 ffd9),next using Image.FromStream(MemoryStream) method to render the jpeg to screen.
First tiem it worked well,but later, we have many types of devices, some device
I cannot using this method to render JPEG stream.I want to know what happend,
i save Jpeg data to my disk,I fond strange thing happend,all application
using GDIPlus (using Image.FromFile methond cannot open these jpeg files),
,But application ,example IE can open these jpeg file well,
I create a new application(.net1.1) drag a PictureBox to winform using Image property,
when i browse local file and selected the Jpeg file ,click OK,it tell me :
GDI+ general error,but in VB6.0 I drag a PictureBox to the form using the same method to select the Jpeg file it works ok .We have a activex component
writter by Vc++ 6.0 it work ok too.Last i fond all application using GDIPlus
when call Image.FromStream or Image.FromFile will throw GDI+ genner error.
So i cannot using pure C# to completed my work,but by ActiveX(written by vc++
6.0)'s help compled my work.but the Jpeg data producted by hardware( we buy from other company,may be CPU is ARM ) so I cannot do some thing to check
hardware.
Thanks again.
|
|
|
|
|
BlueLoveCyn wrote:
First tiem it worked well,but later, we have many types of devices, some device
I cannot using this method to render JPEG stream.I want to know what happend,
If it stopped working, then the data must have changed. If it still works using IE, then perhaps IE is a bit looser in the jpeg format it accepts ?
Christian Graus - Microsoft MVP - C++
|
|
|
|