DataGrid Q: How to force a column to go muti line if necessary to handle the text
I want to have all my columns visible in the window. I've found out how to
disable the column resizing, and even to force the horizontal scroll bar to
hide itself. What I dont know (if it can be done in the WinForms control)
is how to force a cell to go multi line if necessary to show text. I've
seen it done in the Web DataGrid.
For the edification of everyone, here's how to disable column sizing, and
hide the horizontal scroll bar. This, when combined with proper sizing of
the columns, puts everthing on the screen for you:
Do do any of this you must derive your own DataGrid and override stuff.
To make the columns fixed (to prevent the user from increasing their size
and necessitating a scroll bar) you must override OnMouseMove and
OnMouseDown and stop it from calling the base class when a column resize is
being done. To force the scroll bar to hide, hook into the VisibleChanged
event and force it to hide there.
public class MyDataGrid : System.Windows.Forms.DataGrid
{
public MyDataGrid()
{
this.HorizScrollBar.Visible = false;
this.HorizScrollBar.VisibleChanged += new
EventHandler(HorizScrollBar_VisibleChanged);
}
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti = this.HitTest(new Point(e.X, e.Y));
if (hti.Type == DataGrid.HitTestType.ColumnResize)
{
return; //omit base class call
}
base.OnMouseMove (e);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti = this.HitTest(new Point(e.X, e.Y));
if (hti.Type == DataGrid.HitTestType.ColumnResize)
{
return; //omit base class call
}
base.OnMouseDown (e);
}
private void HorizScrollBar_VisibleChanged(object sender, EventArgs e)
{
if(this.HorizScrollBar.Visible == true)
{
this.HorizScrollBar.Hide();
}
}
} Tag: Embedding icons Tag: 53223
Windows Forms Dynamic Properties - Running on a Web Server????
I got in to a situation where we are planning to deploy our WinForms
app in to a web server.
We have dynamic properties already in it, and an XML file to read
certain configurations.
I know that this will give me an exception indicating that it could
not find the the files locally.
Is there a way to run a WinForms app that runs on the web with an
app.config, and an XML file? If so, where would I be able to put it on
the local machine. Tag: Embedding icons Tag: 53221
Events - publish/subscribe and GC'ing
In my application the main thread my create several worker threads that will
create additional objects. These additional objects become "publishers" and
the main thread object (amongst others) then can "register" to receive the
events.
My question is, what happens when the "publisher" object completes it's work
and disappears? Do I need to first broadcast a "please unregister" message
to the subscribers? When the publisher goes away, if the subscribers
haven't unregistered, will this create a leak and/or prevent the GC from
collecting the now demised publisher object?
Thanks! Tag: Embedding icons Tag: 53218
Vertical label
Hi,
Is that possible to rotate a label in a windows form? I
want to have it written from top to bottom.
Please help. Thanks. Tag: Embedding icons Tag: 53211
How to associate icons with menu items
Does anyone know a quick and easy way to place icon images in menu items of
a MainMenu control? This is usually an effortless task for other controls
using their ImageList properties, which is not available for MainMenu. The
only way I can find is to set the menu item's OwnerDraw property to true and
write code to handle the MeasureItem and DrawItem events.
TIA for any input.
Joyce Liu Tag: Embedding icons Tag: 53205
C# Get username (htaccess) when the winform application starts
Hi,
My winform application is accessible via an intranet. To access to
this intranet, I need to enter my login and password. I would like to
get the login in my application to identify the user.
The intranet login type is htaccess and the password type is
htpassword.
Here is my code :
public Form1(string htaccess,string htpassword)
{
// Requis pour la prise en charge du Concepteur Windows Forms
InitializeComponent();
this.user=htaccess;
this.pass=htpassword;
}
static void Main(string[] args)
{
if (args.Length<2)
{
Application.Run(new Form1("",""));
}
else
{
Application.Run(new Form1(args[0],args[1]));
}
}
Actually, I don't know how to obtain this username from the intranet
with this code.
Thanks for your help!
Mathieu Tag: Embedding icons Tag: 53201
How to Display 2 lines in 1 row?
Hi,
I need to display in the datagrid 2 lines for each row,
but I can't find the way to do it. I need to do something
that look like this:
ID/Name | State\Country |---> Header
12 | FL |--->Row1
Charles | USA|--->Row1
23 | IL |--->Row2
Viktoria | USA|--->Row2
Any Idea??
Thanks Tag: Embedding icons Tag: 53200
Splash Screen Problem
Hi,
I'm having a problem with a windows application in VB.NET.
It is an MDI application, and I have just added a splash
screen that is displayed in the beginning of the
constructor of the mainform, and then is hidden at the
end of the constructor (after all the init is done for
the mainform).
The splash screen has a background image that fills all
the form. There is also 4 labels on top the the
background image. The problem is that for some reason,
when the splash screen is displayed, the labels are not
displayed. In fact, instead they act as if they were
transparent, so I see whatever is behind the form on my
desktop.
Any idea what can I do for this?
thanks,
Ross Tag: Embedding icons Tag: 53199
DataGrid row HasErrors
I am creating my own DataGridTextBoxColumn class and I want to display an
"Error" icon when the dataset row has errors. How would I check to see if a
datarow has errors (.HasErrors) from the paint event of a
DataGridTextBoxColumn class. I tried using
Dim strErrorMessage As String = CType(source.Current,
DataRowView).Row.RowError.ToString
but this just looks at the currently selected row.
Any help? Tag: Embedding icons Tag: 53198
OpenFileDialog
Hello,
How use OpenfileDialog in page ASPX?
OpenFileDialog is good in Windows application but isn't good in project
"Application Web ASP.NET"
Thanks Tag: Embedding icons Tag: 53197
MDI Problems
HI!
I've got following problem: I got an app which mainly consists of one
main window. There serveral other windows (which I use for settings),
but there's also one important data-form. The main windows must not be
closed, the other windows must not be modal, they also must not be
AlwaysTop and they also are not allowed to become "invisible" (main
window covers it, cause of operation in main window (to get information
for child window)).
So I've choosen to convert my sdi to mdi. My main window is child
of another window and should always be maximized. Thats my first
problem, cause it doesn't help to cut off the min and max button
(resizing through dblclick on title bar) and I can't make my main
windows the parent window cause it holds several controls and
when I'm showing the child (property/data window), I can't see
anything from the child.
Most of my property windows are created dynamicly through a database,
the size of the window is handled and the Style is set to fixed 3d,
but it got maximized. How can I prevent this?
I'd be very grateful for your answers
Bernhard Tag: Embedding icons Tag: 53194
RowSelect Disabled Datagrid
Hi Everybody,
I have been trying to create a Datagrid wherein
1) the first row is selected by default when the Form Loads.
(Easily done with dg.Select(0))
2) user cannot tab into any column.
ie. unlike the default behaviour which is when the current cell
gets focus,
the existing text inside it is selected and cursor is at the end of
the
textbox.
I can state it alternatively as "the column should not get focus"
3) When user clicks any other row with mouse or moves in the datagrid
using
keyboard, the new row shall get selected.
For this, i have hooked into CurrentCellChanged event to get the
new row
and select it.
My problem is
1) When user presses Tab in the DG, the focus moves along the columns
and
which ever column gets focus, the text in it gets selected and text
within
it gets selected.
I have the row selected, but this columns display is not consistent
with
rest of the columns.
2) As soon as the DG looses focus, the row gets de-selected.
For eg. a Messagebox popup and the row gets de-selected.
3) If user presses tab on the last column of the last row, there is no
row
selected.
My dg.select(rownum) has been coded in CurrentCellChanged so, a row
shall be
always selected. But its not so!!!
As an example of what i want to achive is exactly as implemented in
TASKVISION sample application provided at
http://www.windowsforms.net/Default.aspx?tabindex=7&tabid=44 .
I have gone through the source code of this sample and have set the
properties
of my DG exactly as in the sample, created my TableStyle and
GridColumnStyles dynamically.
Cant Figure out what to do more.
Anybody got ideas/solutions?? Tag: Embedding icons Tag: 53185
Forms Question
Hi,
How to create a sizable form with only a title and a close
(x) button? So no icon, no minimize button, etc.
All help appreciated,
Bert Tag: Embedding icons Tag: 53182
How To: Create an Internet Explorer button in .NET
Using .NET/C#
I need to place a button on the IE toolbar that, when pressed, will invoke
my application and pass it the currect URL.Any examples of this out there?
Thanks,
Steve Tag: Embedding icons Tag: 53171
Bug in Framework 1.1?
I have an application that worked properly in .NET 2002
but doesn't in 2003. It is an MDI application that can
have several open forms with some forms being (virtual)
parents of others. When a user clicks on a parent form,
it attempts to shift the focus back to the child, but this
appears to no longer work in the Framework v1.1. As it is
an MDI application, I can't use the owner variable to make
the parent inaccessible as a form can not be an MDI child
and an owner as well. Disabling the parent also does not
appear to make it inaccessible. So I have no choice but
to call the child forms Show method from the parent's
activate event. It runs the code, but it refuses to cause
the OnActivate delegate or Activated event in the child
form (which it needs to in order to show the children's
children). Is this the way it is supposed to work now?
Does anyone else have a valid workaround? Any help would
be greatly appreciated.
Cheers, Dan. Tag: Embedding icons Tag: 53167
How to intially set a bound combo box value to null
I have a number of combo boxes that are bound to lookup tables.
Whenever the user enters the form the initial value will always be set to
the first value that is in the bound table, so it looks as though a value
has already been selected. Even when setting the selectedindex property
to -1.
Does anyone know how to intially set a bound combo box so that the first
value is not automatically selected?
Thanks,
Daniel Tag: Embedding icons Tag: 53164
What is the best method for creating a "no-touch" client application
I have a WinForms application with a config file that I would like to deploy
internally by making it available on a central server, where it will be
maintained and versioned. I was thinking that accessing it via IE would be
helful, but it is not clear how to handle the config file, which does thinks
such as activate the client remoting capabibility. I would like changes to
this config file to be automatically downloaded with the application.
There is also the problem of default permissions. Although this can be
handled with isolated storage, it is not clear how I can automatically
download any changes to the config file in the central server to this
location.
Is this approach an acceptable one or is there a better method for
accomplishing what I am attempting to accomplish. Tag: Embedding icons Tag: 53159
SQLAdapter - Insert problem
I using a SQLAdapter and Dataset to retrieve and update
rows in a single table ... but I do not know how to
Insert a new row. The table's key column is a auto
generated field so it is read only (and therefore I
cannot make changes to it). How do I specify to the
SQLAdapter that I want an Insert vs. an update?
I haven't tried to delete rows ... but I expect I will
have the same problem.
Any help on this is appreciated.
Thanks!
Dave Tag: Embedding icons Tag: 53154
WebCient Download Method
I'm trying to download a file using the a Webclient
downloadfile method. I dial up my Internet connection, and
once connected, I run my windows app. I'm getting the
following error:
"The underlying connection was closed: The proxy name
could not be resolved, verify correct proxy configuration."
If I navigate to the site, I can access it in my browser,
so I ask:
Is there a setting I can configure or do I have to contact
my ISP?
TIA. Tag: Embedding icons Tag: 53151
DataGrid and Highlight row
I have a datagrid populated from a dataview and while
running a loop, I am able to set the Selected item and
change the background colour of the selected item to say
Green there by giving the grid a scrolling effect as the
loop is processing data rows.
Now depending on ceratin conditions I would like
permenantly set the background color of currently
processed row to say Red etc to indicate an error. I am
not able to do this as a Row cannot be specified directly
in a datagrid. How can I accomplish this.
Thanks,
Rajesh Abraham Chacko Tag: Embedding icons Tag: 53149
Set ComboBox to be Read Only
I am populating a Combobox from a DataReader and the
specified colums are listed fine. Now by default, one can
type in a value when the form is displayed, which I would
like to disable. How can i accomplish this.
Thanks,
Rajesh Abraham Chacko Tag: Embedding icons Tag: 53147
Changing row background color of individual rows in Datagrid
Is it possible to change the background color of
individual rows in the datagrid control?
I want rows to be red when two fields differ.
I.e. a dataset retrieves rows from a database, and then I
want to iterate through rows, and change their color if
the columns "Current product" and "Usual product" appear,
so the user can see if a product out of the ordinary it
at that location.
Regards, Johnsen. Tag: Embedding icons Tag: 53144
Animation control and Modal dialogs
Hi all.
I'm trying a pretty simple thing: show a modal dialog with an animation (AVI
file) playing on it.
- First problem, I couldn't find any native .net windows form control to do
that (at least not part of the original framework)
Question: Is there anything simialr in the .net toolbox?
- Fine, then I decided to use the good old activeX control "Microsoft
Animation Control". I put it in my toolbox then dragged to my form.
I wrote the following code:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
With AxAnimation1
.Open("C:\myfolder\myAnimation.avi")
.Play()
End With
End Sub
If I show the form modeless, it works perfectly. But if I show it modally,
then the animation does not show up.
Questions:
* Do I have to do something extra?
* Is this a known bug/limitation ?
* Can I fix/hack it ?
For now I made my form TopMost=True and disabled all the other forms but
this is less than ideal for me because it shown in front of all the other
applications windows as well. I need it to be the foremost form solely in my
application.
Thanks a lot.
TJ! Tag: Embedding icons Tag: 53139
What is the name for this?
Whilst coding away on a DataGrid and ComboBox I noticed the following
behavior and want to know a) what it's called and b) what's going on
internally within the framework. Basically, I did the normal SqlConnection,
SqlDataAdapter and DataSet creation for a single table in the Northwind
database. I set the DataSource properties of each control to the DataSet
then filled it with the SqlDataAdapter during startup. When the form runs,
the DataGrid displays the table and the ComboBox displays a corresponding
list of product names (ProductName column). So far so good. Now, I haven't
added any event handlers for anything. When I select a new product from the
ComboBox, the DataGrid will move its selction arrow (that thingy on the left
side, whatever its called). Furthermore, if I click on a cell within a row
in the DataGrid, the ComboBox will automatically select the correct
ProductName from its list of items. In other words, by using the DataSet
for 2 different controls they somehow get linked and respond to each other's
events. This is pretty cool and came for free. So, what is this behavior
called so I can investigate a little further? Is it something to do with
BindingContext's? How does the framework connect these 2 and how do they
talk to each other (I'm assuming events but how does that connection get
made?).
Hope someone has an answer.
Thanks,
Mark Schmidt Tag: Embedding icons Tag: 53138
Exceptions not getting propagated across forms.
Hi All,
Our application is a Windows Forms application on .NET
Framework 1.1.
We are having the following scenario:
2 Windows forms - Form1 and Form2.
On click of a button in the Form1, Form2 is loaded.
Now, if an exception is raised in the Form2's load event,
it is caught in the try-catch block of the Form2's Load
method.
When we throw the caught Exception, we expected it to
propagate to the calling form (Form1) and get caught
there.
If we do an F5 (Step-in), the exception raised in Form2
is getting properly propagated to the Form1.
But, when I do a CTRL-F5 (run without debug), the
exception is not getting propagated to the Form1,
The exception is not is getting propagated in the release
mode too.
Could not understand why this is happening. Is it any
know bug in .NET 1.1.
Any pointers to a solution for this would be greatly
appreciated.
Thanks and regards,
Raga Tag: Embedding icons Tag: 53134
"Word-wrap" or mulit-line column headers in a Datagrid
Hi,
This seemed like it would present no problem - until I
tried to do it. I need column heading that wrap to more
than one line, but I can't find a way to do this. Is it
possible?
Thanks Tag: Embedding icons Tag: 53133
How Do I Run External Executable Program From C#?
I want to open and run an external program, such as Windows Explorer or MS
Word, from my C# windows application. Is there a way I can do this?
Tony Lin
Fremont, CA Tag: Embedding icons Tag: 53131
Forms VB 6.0 vs. .Net
OK, I am sure this has been answered a million time, bit
I am new to VB.Net.
I have an app, with 4 forms. In VB 6, I would "Simply"
put a .Show command behind a command button to make the
other form appear. All I see for new documentation is the
reference similar to:
Dim xForm as New Form
xForm.ShowDialog()
I do not want a new form created from scratch, I want to
use my forms with the controls already placed onto them.
Any help would be GREATLY" appreciated. Tag: Embedding icons Tag: 53127
Rename a property with Attributes?
I'm using a PropertyGrid to edit certain objects within
my application. I'd like to be able to change how the
name of certain properties are displayed:
MyObject.MyProperty displays in the PropertyGrid as "My
Property", or "whee fun property" for that matter.
Are there any class attributes that can do this, or do I
have to implement ICustomTypeDescriptor?
I know how I can implement the interface, but am looking
for an easier way out.
Thanks,
Todd. Tag: Embedding icons Tag: 53123
Datagrid: Specified argument was out of the range of valid values
Hi:
I don't know if this is a .NET bug. The user enters certain values
and obtains the results from an array list which is bound to a
datagrid. The first time works fine. The second time, when the user
changes a value and then re-executes the code, I get this exception
"Specified argument was out of the range of valid values. Parameter
name: rowIndex". I stepped through my code to see where the problem
is. After refreshing the datagrid, if I type in the command window
?dg, and then execute the code, it does not give me that exception.
the error occurs at this line of code:
Dim strInterest as string =
Ctype(datagrid.Item(datagrid.CurrentRowIndex,2), String)
Any help is welcome. What seems to be the issue here.
Thanks
Eashwar Tag: Embedding icons Tag: 53122
2 Different Types of Unhandled Exception Error Dialogs...
Would anybody be able to explain why an unhandled exception error generates
a different dialog under certain circumstances. Usually, the more friendly
dialog that includes a stack trace will be displayed. However, there are
occasions where all you get is a process ID and a thread ID and the
application does not offer the standard "Continue" button.
Thanks,
Brian Tag: Embedding icons Tag: 53120
Inheriting Windows Control as Abstract Class
Hi,
we'd like to define an abstract library class for a windows control, where
we specify a couple of abstract methods in order that they must be
overridden and implemented differently in each derived class.
We've tried creating the base abstract class and the derived class in the
main project but this leads to the following error appearing in the designer
view of the derived class:
"The designer must create an instance of "IamsPack.ctlIamsPackBase" but it
can't because the type is declared as abstract"
The funny thing is that the designer view displays fine when we first open
the solution, and then gives an error after we've run the application from
within Visual Studio.
I've read in another post that it's more stable to create the base class in
a separate library DLL and then add a reference in the main project. But
before I do that I'd like confirmation whether there is any problem with
making the base class abstract. Any feedback/suggestions would be greatly
appreciated.
Thanks,
Mauro Ciaccio Tag: Embedding icons Tag: 53117
column values in a datagrid
Can anyone point me to the syntax on how to fetch
indiviual column values from the current row in a
datagrid on a button click in C# or VB. Tag: Embedding icons Tag: 53112
column values in datagrid
Can anyone point me to the syntax on how to fetch
indiviual column values from the current row in a
datagrid on a button click in C# or VB. Tag: Embedding icons Tag: 53111
Event Order
I have yet to find a description of the order/description
of Form events. The MSDN Docs only describe how to
overload and delegate these events.
What's the difference between Form.Activate/Form.Load?
I need to execute a routine when the form has been
completely drawn onscreen.
-Peter Tag: Embedding icons Tag: 53109
DataGrid multiple selection
I think there is a bug in DataGrid.IsSelected. This
method apparently returns wrong selection states in most
cases.
Dies anyone know a possibility to manage multiple
selection in datagrid correctly without programming the
whole beheaviour in a derived control?
Thanks for any help Tag: Embedding icons Tag: 53108
Dynamic Sockets Settings
I need to be able to do the following and I'm not sure if
it can be done, or how to do it.
Socket A will send a request to Socket B which will be
listening.
Depending on the info received, Socket B will then forward
the request to a Socket C or a Socket D.
Socket B must then wait for a response from Socket C or D,
and then respond to Socket A.
Question: Can Socket B dynamically listen and redirect
requests to a different IPs depending on the received
message. If so, an example or reference will be greatly
appreciated.
TIA Tag: Embedding icons Tag: 53100
Docking Window on Screen
background:
I am using C# .NET Framework 1.1, trying to immitate the docking behaviour
of Programs like ICQ.
issue:
I do not want to dock Controls within my Program, I want to give my user the
ability, to dock my Program itself to any part of the screen (like ICQ or
the Windows TaskBar).
problem:
I kept on searching the net for information regarding my issue, but didn't
find anything of use. Every article I found talking about dotnet and
docking, was talking about how to dock controls within my Container, but no
article mentioned how to dock the windowsform itself to any part of the
screen.
question:
Do you have any idea, what I could do?
Any help is appreciated,
thx,
James Jeff Tag: Embedding icons Tag: 53097
one .EXE run as application AND as a Service?
This is probably an advanced question. But does ANYBODY know if possible,
and how, to have one EXE run as both (a) Windows Form Application, and (b)
an NT Service.
One thought I've had (but not tried yet) is to create a module that inherits
from ServiceBase class and to have that instanciate and load the form
(Front-end). But at the same time be able to add/remove the service from the
CSM.
The Plan:
To have a GUI where a user can use the application in a normal fashion - the
application is essentially a monitor/logging application. I then want the
ability to be able to have the application run as a service, or not run as a
service - based on the user setting an option in my options screen.
If anybody has any source/documentation on how to do something like this, it
would be greatly appreciated.
Thanks all,
Nate. Tag: Embedding icons Tag: 53096
GDI programming question (from a newbie)
I'm trying to paint rectangles using GDI (I'm implementing drag and drop and
want to paint a dashed rectangle as I drag a control to a new position). I
instantiate a Rectangle object ok and handle its painting in the form's
Paint event. This works fine, but the rectangle always appears "underneath"
other objects on the form - I want it to always appear over the top of them.
How can I achieve this ? Tag: Embedding icons Tag: 53094
DataGrid and Button Shortcut
Hi,
i have a datagrid on a form and a commandbutton with a
shortcut (t).
my datagrid have the focus and the user can search inside
the grid with the a-z keys. in keypressevent of the grid i
collect the user pressed keys to search the right datarow.
but if the user presses the button shortcut key the button
click event will fired without pressing "alt-key". this
key dont come to the datagrids keypress!
Any ideas? Tag: Embedding icons Tag: 53092
Windows Form in an ActiveX Control
Is there a possibility to wrap a windows form into an
activex control? Or is there any other chance to get a
windows form into a MMC snap-in? Tag: Embedding icons Tag: 53090
Validating and Closing form
Sun. Jul. 27, 2003 9:10 PM PST
I have a simple windows form with some textbox controls. I am validating
these controls in their validating event. Now my problem is if the focus is
on the textbox control and it has validating event, and if I want to close
the form it always try to validate the control. Whereas I want to discard
that particular record and as user wish to close the form so it should close
it. but it seems validating event becomes sticky. as it calls enter,
gotfocus, leave, validating, validated, lostfocus events in chain. Now even
if you put a cancel button and try to set forms CausesValidation property to
false, you will not reach to the click of cancel button.
Has anyone found any workaround to this problem?
User may close the form by clicking on close button, alt + F4, or from menu
command.
Isn't it a challenging ? Tag: Embedding icons Tag: 53086
Windows Forms Inheritance From DLL duplicates Controls
There seems to be a problem inheriting a windows form from a dll. If
you inherit the form from a dll, rather than from a form in the
current project, all of the controls are duplicated in the
InitializeComponent() the first time something is added or modified.
Is this behavior by design or is it a bug?
Thanks,
Kurt Tag: Embedding icons Tag: 53085
Imagelist and PNGs with alpha transparency
In my VB.Net application I am using ImageLists to hold images for use by
toolbars/treeviews etc. The imagelist.colordepth properties are all set to
Depth32Bit, and then the Images collection is loaded with the various PNG
images, all at design time. The PNG files all have nice alpha blended edges,
and drop shadows.
When I run the application from within the VS.Net environment, everything
displays as I would expect it to. However, this is not so when the .exe is
run manually. If I don't use Application.EnableVisualStyles, then the alpha
blended edges are replaced with solid blue pixels around the icons. If I do
use Application.EnableVisualStyles, then I get no icons at all!
What am I doing wrong?
If I use a .manifest file, then it works correctly (irrespective of whether
I use Application.EnableVisualStyles or not). I thought that
Application.EnableVisualStyles was supposed to fix this sort of thing?
Running on Windows XP Pro, and using VS.Net 2003. All graphics drivers are
uptodate.
--
</Slugsie>
-=+Team ToolFox+=-
[paul_at_slugsie_dot_co_dot_uk] Tag: Embedding icons Tag: 53083
Making the mouse cursor wrap around the desktop
My goal is to create an app that measures the distance my mouse has
moved, and wraps the mouse around should it reach the edge of the
screen. I have been able to track the mouse around the desktop using
SetWindowsHookEx (thanks Claes Bergefall!). Now what I want to do is
to move the mouse cursor. For instance:
If Cursor.Position.X < 10 Then
Cursor.Position = New Point( _
Screen.PrimaryScreen.Bounds.Width, _
Cursor.Position.X)
End If
The problem is that the Cursor.Position does not seem to work if
called while the mouse is moving.
Any help appreciated,
J Wolfgang Goerlich Tag: Embedding icons Tag: 53082
PerformanceCounter, Categoryname=LogicalDisk?
Hi,
I want to use the PerformanceCounter to get some disk information from our
server. I know that I can set the property CategoryName to PhysicalDisk to
get some things I am interested in, but in stead of getting the information
on physical disks, I would rather have the information per logical disk. Is
this possible?
I would have expected that an option LogicalDisk would be available for the
property CategoryName, but there isn't. Is there another way to get this
information? I am using VB .Net
Thanks in advance,
Sandra Tag: Embedding icons Tag: 53081
I want to embed some icons into my application and then use these icons for
specific file extension.