|
I have an application that allows users to, using the mouse, click and hold a control and move it to another location on the form.
How do I draw that un-filled drag rectangle that shows the user that they are moving something around. I need to be able to draw this drag rectangle anywhere on the screen (on the app, over other controls, on the desktop) not just on the application itself.
Your help is appreciated.
|
|
|
|
|
The class 'System.ControlPaint' has some methods with the name 'Reversible' in them that draw onto the screen. If you use FillReversibleRectangle then you could draw four of them to get the drag rectangle you are looking for. There is only one problem with this though, you have to give a Color and so it will be a solid border around your control and not the stipled effect you want.
|
|
|
|
|
Write a program that inputs ONE 2-digit number (%d) ,
output the number by separating the number into its individual digits by a new line.
eg. input 76 output 7
6
eg. input 99 output 9
9
how to write ?
thx~~
RR
|
|
|
|
|
int inputnr;
int ten;
int one;
ten = (int) inputnr / 10;
one = inputnr % 10;
cout << ten << "\n" << one;
think this should work... at least i hope so..
bernhard....
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
How to get disk label, the name of disk map, cd name.?
How to get name of My computer icon on desktop?
Thank
|
|
|
|
|
I am building a mdi windows application. but when i create a child window, such as "New File" , i wants to dock the child window. but it do not work.
below is the related source:
private void File_NewDoc_Click(object sender, System.EventArgs e)
{
//TextView is a Form which contains a RichEditBox control.
this.frmTextView = new TextView ();
this.frmTextView .MdiParent = this;
this.frmTextView .Dock = System.Windows.Forms.DockStyle.Bottom;
this.frmTextView .Show ();
}
What's Matter?
|
|
|
|
|
I suspect the problem is that a MDI child Form is not going to allow itself to be docked within an MDI parent. It just doesnt make much sense.
|
|
|
|
|
If i set the Windows to Tool windows or dialog, do it work? i realy don't know which properaties of windows or dialogs are related to the dock action.
The Internet Give a Chance to Learn. I Do!
|
|
|
|
|
Does anyone know what happened to UnmanagedType.LPVoid in beta 2. After spending many hours/frustration trying to figure it out I concluded its not in beta 2. Though it was in an earlier version, an example on CP even uses it. The only reference I found on MSDN was here
Hmmm, I wonder if it was replaced by something else or something...
|
|
|
|
|
Try using IntPtr instead.
|
|
|
|
|
I tried using IntPtr using several tricks none of which works. What I am trying to do is call a win32 api, using C#. I did what I wanted easily in managed C++ with the features I wanted, though I thought it would be better if I can get it in the same project and hence use C# rather than using an external dll.
Lets take an example NetServerEnum, which I adapted from here to use beta2:
--------------
[DllImport("netapi32.dll")]
unsafe private static extern uint NetServerEnum(
[MarshalAs(UnmanagedType.LPWStr)] string ServerName,
uint level,
//In my test I try to change this next line
//with something appropriate, though no LPVoid
//I tried some of the other types with no
//success
[MarshalAs(UnmanagedType.LPVoid)]uint* bufptr, uint prefmaxlen,
ref uint entriesread,
ref uint totalentries,
uint servertype,
[MarshalAs(UnmanagedType.LPWStr)] string domain,
uint resume_handle);
--------------
At the end of the day I get one of two results depending how I approach it.
A.It compiles, but the function returns error 87 which stands for 'The parameter is incorrect.'
B.An exception
--------------
Unhandled Exception: System.Runtime.InteropServices.MarshalDirectiveException: C
annot marshal parameter #3: Invalid managed/unmanaged type combination pointers must be paired with LPVoid).
--------------
I made a managed C++ component to do what I want(didn't take more than a couple of minutes), but was trying to compact things by not using managed C++ if I don't have. And since something similar was done in beta1 I was thinking it should be easily done in beta2, though I am not sure what I am overlooking here.
Thanks.
|
|
|
|
|
I think you'd want to define the bufptr parameter as:
ref IntPtr bufptr
With your current code, you're just passing a pointer, rather than a reference to a pointer. Once you get the IntPtr out, it's fairly easy to cast it to whatever pointer type you want.
|
|
|
|
|
Thanks.
Thats the way I tried it, though something you said made me think about the size and hence error 87. I tried a couple of pointer tricks and it worked! Again thanks for the tip on the change from LPVoid to IntPtr(If it was indeed a change )
|
|
|
|
|
how do i make it so if im making like an output box, like the old Debug window, where i can print stuff like, "Opening File...", "Transfering Data..." and stuff like that, how do i enter to a new line...like hitting the 'ENTER' key...i know in VB6.0 it is vbclrf or wuteva but wut is it in c#?
|
|
|
|
|
ooh ooh i know i know!!, oh wait, im answering my own question
you declare to chars with hexadecimal code:
char charreturn = '\u000D' //0 = Zero
char linefeed = '\u000A' //0 = Zero
textBox1.Text = textBox1.Text + charreturn + linefeed + "Your statement!"
hehe, sometimes i make myself laugh, other time i hit myself cause im stupid!;P
|
|
|
|
|
In my application, it needs a dialog of folder selection. Are there a predefined dialog in Windows 2000?
Sorry, I am a beginner of Windows Application Programmer.
|
|
|
|
|
opendialog opnfile=new opendialog();
opnfile.filte=....
opnfile.text=....(sorry,I don't remember,please youself look for it in MSDN)
if (opnfile.0k=...)
{
string filename=opnfile.filename;
}
hope this helps!
regards
Iverson
|
|
|
|
|
In C#, i used a BrowseforPath() function in Shell32.dll.
The Internet Give a Chance to Learn. I Do!
|
|
|
|
|
I’m trying to mimic the functionality of the Visual Studio.NET Start Page. I’d like to be able to create hyperlinks to recently used projects and create buttons that will invoke an OpenFileDialog or other dialogs. Right now, I have an Internet Explorer ActiveX control in a Windows Form. Somehow, I need to call member functions of the parent form from within an HTML document (or at least it seems to me that that’s what I need to do).
I was looking in MSDN and I found the IDocHostUIHandler interface that has a GetExternal function. GetExternal returns an IDispatch pointer which I think (hope) will allow an HTML document to interface to the parent form via IDispatch’s Invoke method.
It looks like this may provide the functionality I’m looking for, but I can only find how to implement it in C++. Does anybody know how to do this in C# (or any .NET language)?
Or, if you’ve done something like this in C++, let me know if I’m on the right track here.
Thanks.
Stephen
|
|
|
|
|
Hi people !,
help please !! how can you facilitate Web Service to Windows Forms communication ? (or at the least, what's it called ?)
what i mean is, suppose you invoke a Web Service function that should update a TextBox on separate Windows Forms application . they are both on the same machine.
thanks ! any help would be greatly appreciated !!!!
|
|
|
|
|
Hi there,
I have never even touched C# yet, but I can see that in the next few months I will.
I was wondering whether an application written in C#, will work on old windows environment or whether it's only for the .NET environment and XP?
thanks
|
|
|
|
|
yes it will, because i installed it on my computer and i have made programs in C# that ran on winME...but then again, XP is based off NT and 2000 and ME...so i dunno...what is XP based off of lol, i wasnt sure if im correct on that...yea, ill shut up now
|
|
|
|
|
you can install the .NET redistributable on the target machines....[approx-17 MB download]
then all your .NET apps will work....
Nish
|
|
|
|
|
Where can I find an estimated number of C# developers?
|
|
|
|
|
Hi all,
I'm creating an application in which I have 2 forms that are side by side. When one moves one form, the other form also moves keeping the exact distance between the two forms (i.e. move in parallel). I'm looking for some insight into how to do this. I was thinking of grabing the main forms position on the screen and adjusting the second window according.
2 question:
1. Is this the right approach?
2. How does one determine the position of a window on the screen?
|
|
|
|