|
While it may not be possible to have the size of the form to be more than the maximum screen size, if your objective is to put more controls in an area bigger than the maximum screen size, for all practical purposes you can achieve that by following steps:
1. Have the Form of the whatever size you prefer (including a size equivalent to the maximum size of the screen if you so wish).
2. Set the AutoScroll property of the form to true.
3. Now place a control such as Panel Control on this form. Set the size of the Panel to any numbers of your choice (which may be even greater than the maximum screen size). For example, you can set the size of the Panel as (1500, 1500).
4. Now place other controls (of your choice) on this Panel at various locations. For example, let textBox1 be located at 100, 100 location and another textBox2 be located at the location 1400, 1400.
5. You will notice that horizontal and vertical scrolls are enabled on the Form when the application is run. It can be seen that while the form size is limited to the maximum of the screen size, yet the size of the Panel is set to go even beyond the maximum screen size, which you can access through the scrolls. You can check the position of the two textBoxes at two extreme ends of the form window using scrolls.
|
|
|
|
|
g'day folks,
well i am stuck on the issue of being able to permit multi selection of listbox items in a checked listbox. I have tried setting the selectionmode to MultiExtended or MultiSimple and visual studio simply spits an error saying that "Multi selection not supported on CheckedListBox".
I just want to be able to permit user to press CTRL and Left Mouse Button click to allow multiple items to be selected.
I tried invoking the KEY DOWN event handler to allow an item to be selected when the control key is pressed but just doesnt seem to work.
So I was wondering if anyone here knows of a way around this and could share this idea ?
thanks
|
|
|
|
|
You need to do this yourself, I am afraid, since - as you mentioned - multi-select is not possible with a CheckedLB.
With a Checked LB, you are supposed to check the Boxes, not multi-select items. IMHO, you are not supposed to have an amount of items in there that makes Multi-Selection necessary.
You might be able to pull it off by "rewriting" the CheckedListBox, but I have not tried that yet.
|
|
|
|
|
Right, I'm new to threads and the beginners tutorials I've read don't seem to discuss this. It's got to be a common problem.
Basically its an IRC program that and the bit that listens for server messages. I'm using third part low-level code, and basically I need to call a function listen() to get all the messages recieved since the last call. To loop over this I presume I need a seperate thread that just loops calling it over an over, and then passing an event to the main thread with the data. However I don't know how to communicate across threads in this way. The tutorials I've read show how to acess a shared object.
Its got to a be a common multi-threading problem, whats the solution?
|
|
|
|
|
You shouldn't need to use a thread for something like this. All you really need is a timer, with the event handler Tick() calling your listen() function.
If you're set on threads, you would create a thread somewhere in your class:
Thread mythread
and then when you're ready to run the function,
<br />
mythread = new Thread(new ThreadStart(listen));<br />
mythread.Start();<br />
mythread.Join(System.TimeSpan(0,0,10));<br />
mythread.Abort();<br />
The listen function would write to a global or semi-global string, that you would read into your program. The System.TimeSpan object can be whatever you want (its how long that function has to run).
I would still use timers for this, you would use threads to allocate a given time for your client to connect to an IRC server.
Hope that helped,
Jimmy Sawczuk
www.McJournal.org
|
|
|
|
|
Hey folks,
Do you guys know how to write a piece of code to list all the COM+ components in Windows 2003 using C#. I don't know what API to call.
Thanks.
|
|
|
|
|
Hi!
I have to marshall a struct which contains a array.
the marshalling works for the following one:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct STRUCTa
{
public ulong ulMountedDrives;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1664)]
public short[] wszVolume;
}
but i need a two-dimensional array, the marshalling chancels with System.ArgumentException.
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct STRUCTa
{
public ulong ulMountedDrives;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1664)]
public short[,] wszVolume;
}
i marshall the struct in the programm with:
STRUCTa sStruct = new STRUCTa();
IntPtr point = Marshal.AllocCoTaskMem(Marshal.SizeOf(cMntStruct));
why does version one work, but version 2 fails?
anybody got a resolution for this problem?
thanks for your help
53746F6E65
INT 19H
|
|
|
|
|
UnmanagedType marshalling is complicated and the MSDN does a generally sh*tty job of explaining how to implement it for anything other than a simple type.
Since no one has responded to this, I'll suggest a hack workaround.
Instead of trying to decipher that documentation mess in the MSDN, you might want to just have your unmanaged code pack the entire array into a single dimensional column major based array, then have the C# code enumerate the 1-D array back into the original 2-D array. If the dimensions are variable you could add parameters to the structure that the unmanaged code could supply to make it easier to unpack the single data stack on the C# side.
In other words make a single stack array that has a structure something like:
Array[0] = Column(0), Row(0)
Array[1] = Column(0), Row(1)
Array[2] = Column(0), Row(2)
Array[3] = Column(1), Row(0)
Array[4] = Columns(1), Row(1)
Array[5] = Column(1), Row(2)
etc....
Maybe a little crude, but it would work...
Robert
|
|
|
|
|
I have found another way which works fine:
if you got a 2D array with 20x20 just make a 1D array with 400 Elements
53746F6E65
INT 19H
|
|
|
|
|
Hi
I have created a Setup and Deployment Winform Application.
While installation the setup routine asks the user for the Folder in which the application should be installed in.
I want to read the Folder name chosen by the user in my application.
Is there any way to read the Folder name from the application.
regards
rt7.
rt7
|
|
|
|
|
Uhhh Didn't you write the application? What do you mean you want to "read the Folder name chosen by the user in my application"? If you asked the user for the folder, what's stopping you from reading what the user typed?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I wrote the app.
I used the Setup and Deployment Project type, that displays the Folder Name to which app should be installed automatically.
Any more questions ?
thanks..rt7.
rt7
|
|
|
|
|
|
That makes alot more sense than what you originally posted. What you said before sounded like you made a your own custom Setup and Deployment application that is used to install other applications.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there! I have a question regarding .NET C#. I have read that globals are no longer a element of .NET C# that instead they call them static variables. However I was wondering is it possible to share static variables between different classes that are within the same project. If so please let me know. I am trying to figure out a efficient way of passing this array[200] of structs, that I have created between two classes. Any help you could pass my way would be great.
-C# Newbie
|
|
|
|
|
C# .NET Newbie wrote:
I have read that globals are no longer a element of .NET C# that instead they call them static variables.
No, that is wrong. Globals have been bad programming practice for a long time, but they were available in C++, which also had/has static variables.
C# .NET Newbie wrote:
However I was wondering is it possible to share static variables between different classes that are within the same project
If a class has a public static variable, then any other class can access it. I've worked on excrable VB.NET code with a class called 'Globals' that does this.
C# .NET Newbie wrote:
I am trying to figure out a efficient way of passing this array[200] of structs, that I have created between two classes.
The most logical thing I would suspect is that the array needs to sit in a third class that these two classes commonly access. It sounds like it belongs to neither one class or the other. If this is not the case ( it belongs to one, but the other needs to use it ), then you need to pass it to this class, either in the method that uses it ( if it's commonly used in class two, see my first suggestion ), or perhaps via a delegate that can be called to retrieve it as needed.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
HI!
I was wondering if it is possible to create a chat application using web services? i want to be able to chat via lan and internet.. and with an application or with a web page, is it possible?
THANKS!!
|
|
|
|
|
Hello All,
I working with a SIP phone Com Component. I use it in weba application but i got this error when i use it.
Catastrophic failure <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Runtime.InteropServices.COMException: Catastrophic failure
Please help...
Regards,
Hay
|
|
|
|
|
Your COM component has blown up. This means that either
a/ it's crap
b/ you've passed in invalid data AND it's crap.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Could it be that the component won't work in a web page? It's entirely possible it will only work in a Windows Forms application.
... and it's crap!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am new to C# and still learning…so for you pros out there, I’m sure this is a piece of cake.
Using Windows 2000 Server ( .NET Framework 1.1 )
#1. I need to (uncheck) not allow inheritable permissions from a parent to propagate to this object & copy previously inherited permission to this object.
#2. Add a user from Active Directory to the folders permission with Modify, Read & Execute, List Folder Content, Read and Write allowed permission.
Any help would be greatly appreciate
Thank you,
Mark
markaelkins@gmail.com
|
|
|
|
|
|
I could only find information on file permission, not folder permission?
|
|
|
|
|
Hi,
I built a windows form client app in c# that access a db on a network. Now I was wondering how can I set it up so that the app can accesses the database through the web? I don't want to rebuild the client app into an asp.net app. Maybe I could or should use Web Services that sits on a web server with database and do my updating through this route. What do you guys/gals think?
Thanks,
JJ
|
|
|
|
|
Help ~
I am currently working on a project that will create Word documents. Everything was going great until I tried to run the application on a machine w/ Office 2003. This is where I found out about PIA's.
I have taken the MSWORD9.OLB file and generated an assembly for it and move the new Microsoft.MSWORD9.dll file to the machine w/ Word 2003 everything works great - accept that my machine (which has Word 2000) is now throwing the following error **
System.InvalidCastException QueryInterface for interface Microsoft.MSWORD9._Application failed
I have add the assembly to the GAC and registered it - the lines of code where the error is thrown are as follows:
_WordApp = new Microsoft.MSWORD9.ApplicationClass();<br />
_WordDoc = _WordApp.Documents.Add(ref Missing, ref Missing, ref Missing, ref IsVisible);
Any help will be greatly appreicated
Michele
Mercer Engineering Research Center
mstusak@merc.mercer.edu
|
|
|
|