intercepting keypress
Hello to everybody.I have a problem.I have a property
grid that display several properties of a object.I have a
properties that store the image but I want to display the
file name.So I have modified the editor of the image and
the typeconverter of the image.
So I have inherit from ImageConverter and from
ImageEditor. Everything work fine but when I press the
CANC button on the property of the image it doesn't
cancel the image but the name of the file.(only one
charachter each time).Anyone know how to intercept the
keypress event in my custom image editor or im my custom
image converter? Tag: Handling ListView Click and DoubleClick Tag: 60870
TURN Rs60/- into Rs3,00,000/- IT REALLY WORKS
TURN Rs60/- into Rs3,00,000/- IT REALLY WORK
WANT TO EARN CASH?? NO SCAMS!! NO TRICKS!
Have you fell for the DON LAPRE/CARLTON SHEET
SCHEMES. You'r
not the onl
one! Although these programs do have som
valuable info, the
don't tell you anything that you can't find a
your loca
library. Just look up "mail order" or "Mone
Makin
Opportunities"! Yeah Don Lapre is rich but hi
wealth come
fro
selling us his program for $39.99
KEEP READING!!! IMPORTANT!!! CHECK THIS OUT
BELOW IS
PERFECTLY LEGAL PROGRAM THAT IS MORE EFFECTIV
THAN DO
LAPRE'
AND IT ONLY COSTS Rs60.00/- HOW TO TURN SIXT
RUPEES INTO THRE
LAKHS ! READING THIS COULD CHANGE YOUR LIFE
IT DOES WORK
I found this on a bulletin board and decided t
try it.
littl
while back, I was browsing through newsgroups
just like yo
ar
now, and came across an article similar to thi
that said yo
could make thousands of dollars WITHIN WEEK
with only a
initial investment of Rs60/
So I thought, "Yeah right, this must be
scam", but like mos
of us, I was curious, so I kept reading
Anyway, it said tha
you send Rs10/- to each of the 6 names an
address stated i
th
article. You then place your own name an
address in th
botto
of the list at #6, and post the article in a
least 20
newsgroups. (There are thousands) No catch
that was it. S
after thinking it over, and talking to a fe
people first,
thought about trying it. I figured: "what hav
I got to los
except 6 stamps and Rs60/-, right?" Then
invested the measl
Rs60/
Well GUESS WHAT!?... within 7 days, I starte
getting money i
the mail! I was shocked! I figured it would en
soon, but th
money just kept coming in. In my first week,
made abou
Rs250.00. By the end of the second week I ha
made a total o
ove
Rs11,000.00! In the third week I had ove
Rs 87,500.00 and it'
stil
growing. This is now my fourth week and I hav
made a total o
just over Rs 1,70,000.00 and it's still coming i
rapidly. It'
certainly worth Rs 60.00, and 6 stamps, I hav
spent more tha
tha
on the lottery!! Let me tell you how this work
and mos
importantly, WHY it works... Also, make sur
you print a cop
o
this article NOW, so you can get th
information off of it a
you need it. I promise you that if you follo
the direction
exactly, that you will start making more mone
than yo
though
possible by doing something so easy
KEEP READING TO FIND OUT HOW THIS WORKS!!
Suggestion: Read this entire messag
carefully! (print i
out o
download it.) Follow the simple directions an
watch the mone
come in
It's easy. It's legal. And, your investment i
only Rs 60.0
(Plu
postage on only 6 envelopes...one tim
only...no repea
mailing
IMPORTANT: This is not a rip-off; it is no
indecent; n
misleading promises or claims; it is no
illegal; and it i
99
no risk - it really works
If all of the following instructions ar
adhered to, you wil
receive extraordinary dividends
JUST KEEP READING!!! PLEASE NOTE: Please follo
thes
direction
EXACTLY, and Rs5,00,000/- or more can be yours in 2
to 60 days
Thi
program remains successful because of th
honesty an
integrit
of the participants. Please continue it
success by carefull
adhering to th
instructions
You will now become part of the Mail Orde
business. In thi
business you
product is not solid and tangible, it's
service. You are i
the business of developing Mailing Lists. Man
larg
corporations are happy to pay big bucks fo
quality lists
However, the money made from the mailing list
is secondary t
the income which i
made from people like you and me asking to b
included in tha
list
Here are the 4 easy steps to success
STEP 1: Get 6 separate pieces of paper an
write the followin
on each piece of paper "PLEASE PUT ME ON YOU
MAILING LIST.
No
get 6 INDIAN Rs 10.00 Notes and place ONE inside EAC
o
the 6 pieces of paper so the bill will not b
seen through th
envelope (to prevent thievery). Next, plac
one paper i
each o
the 6 envelopes and seal them. You should no
have 6 seale
envelopes, each with a piece of paper statin
the abov
phrase,
your name and address, and a Rs10.00 note. What
you are doing is
creating a service. THIS IS ABSOLUTELY
LEGAL! You are requesting a legitimate service
and you are
paying for it!
Mail the 6 envelopes to the
following addresses:
#1) kawal Deep singh
SMQ 200/5 Old Project
AF Station ,Halwara A.D
Ludhiana,Punjab
India-141106
#3) Lac. Tiwari P.K
SLS,AF Station
Cotton green ,Mumbai-33
India
#4) G.S Dhody
New abadi,air force station
Halwara A.D ,Ludhiana
Punjab ,India-141106
#5) Amar deep singh
I-12,west patel nagar
New delhi -110008
#5) Kawal deep singh
Gali no23house no 692,
DDA Flats madangiri,
new delhi
India-110062
#6)Atul Mittal
House No: 694 Sector 11-B, NEAR GIRLS ARCHITECTURE HOSTEL
CHANDIGARH
India-160011
STEP 2: Now take the #1 name off the list that
you see above,
move the other names up (6 becomes 5, 5
becomes 4, etc...)
and
add YOUR Name as number 6 on the list.
STEP 3: Change anything you need to, but try to
keep this
article as close to original as possible. Now,
post your
amended
article to at least 200 newsgroups. (I think
there are close
to
24,000 groups) All you need is 200, but
remember, the more you
post, the more money you make! You won't get
very much unless
you post like crazy.
Keep a copy of these steps for yourself and,
whenever you need
money, you can use it again, and again.
PLEASE REMEMBER that this program remains
successful because
of
the honesty and integrity of the participants
and by their
carefully adhering to the directions. Look at
it this way. If
you are of integrity, the program will continue
and the money
that so many others have received will come
your way.
NOTE: You may want to retain every name and
address sent to
you,
either on a computer or hard copy and keep the
notes people
send
you. This VERIFIES that you are truly providing
a service. (Also, it might be a good idea to
wrap the Rs10/-
bill in
dark paper to reduce the risk of mail theft.)
So, as each post is downloaded and the
directions carefully
followed, six members will be reimbursed for
their
participation
as a List Developer with Ten Rupee each. Your
name will move
up
the list geometrically so that when your name
reaches the #1
position you will be receiving Lakhs of Rupees
in CASH!!!
What an opportunity for only Rs60/- (Rs10.00 for
each of the
first
six people listed above) Send it now, add your
own name to the
list and you're in business!
---DIRECTIONS ----- FOR HOW TO POST TO
NEWSGROUPS------------
Step 1) You do not need to re-type this entire
letter to do
your
own posting. Simply put your cursor at the
beginning of this
letter and drag your cursor to the bottom of
this
document, and select 'copy' from the edit menu.
This will copy
the entire letter into the computer's memory.
Step 2) Open a blank 'notepad' file and place
your cursor at
the
top of the blank page. From the 'edit' menu
select 'paste'.
This
will paste a copy of the letter into notepad so
that
you can add your name to the list.
Step 3) Save your new notepad file as a .txt
file. If you
want
to do your postings in different settings,
you'll always have
this file to go back to.
Step 4) Use Netscape or Internet explorer and
try searching
for
various newsgroups (on-line forums, message
boards, chat
sites,
discussions.)
Step 5) Visit these message boards and post
this article as a
new message by highlighting the text of this
letter and
selecting paste from the edit menu. Fill in the
Subject, this
will be the header that everyone sees as they
scroll through
the
list of postings in a particular group, click
the post message
button. You're done with your first one!
Congratulations...THAT'S IT! All you have to do
is jump to
different newsgroups and post away, after you
get the hang of
it, it will take about 30 seconds for each
newsgroup!
**REMEMBER, THE MORE NEWSGROUPS YOU POST IN,
THE MORE MONEY
YOU
WILL MAKE! BUT YOU HAVE TO POST A MINIMUM OF
200** That's it!
You will begin receiving money from around the
world within
days! You may eventually want to rent a P.O.Box
due to the
large
amount of mail you will receive. If you wish to
stay
anonymous,
you can invent a name to use, as long as the
postman will
deliver it. **JUST MAKE SURE ALL THE ADDRESSES
ARE CORRECT.**
HERE'S HOW Rs60.00 TURNS INTO LAKHS!!
Out of 200 postings, say I receive only 6
replies (a very
low
example). So then I made Rs60.00 /-with my name at
#6 on the
letter.
Now, each of the 6 persons who just sent me
Rs10.00 make the
MINIMUM 200 postings, each with my name at #5
and only 6
persons
respond to each of the original 6, that is
another Rs360.00/- for
me, now those 36 each make 200 MINIMUM posts
with my name at
#4
and only 6 replies each, I will bring in an
additional
Rs2160.00/-
Now, those 216 persons turn around and post the
MINIMUM 200
with
my name at #3 and only receive 6 replies each,
I will make an
additional Rs12,960.00/-
OK, now here is the fun part, each of those 1296
persons post a
MINIMUM 200 letters with my name at #2 and they
each only
receive 6 replies, that just made me
Rs77,760/-
Those 7,760 persons will all deliver this
message to 200
newsgroups with my name at #1 and if still 6
persons per 200
newsgroups react I will receive Rs4,66,560 /-
With an original
investment of only Rs60.00/- AMAZING!
When your name is no longer on the list, you
just take the
latest posting in the newsgroups, and send out
another Rs60.00
to
names on the list, putting your name at number
6 again. And
start posting again. The thing to remember is:
do you realize
that thousands of people all over the world are
joining the
internet and reading these articles everyday?,
JUST LIKE YOU
are
now!! So, can you afford Rs60.00/- and see if it
really works?? I
think so...
Thousands of people are
joining the internet each day and reading
articles like
these just as you are right now. So this can
never be played
out.
Just keep it going and you can make tons of
money too!!!!
Please
try it now and make big bucks in a few short
weeks!!!!!! Tag: Handling ListView Click and DoubleClick Tag: 60868
Force Printing to a printer based on the given printer name
I have created a print button in my windows and web applications. I have two
printers. One printer is located at server and another one is at client. The
problem is every times I print at client it will spool to my server printer.
I wanted to force print directly to my client's local printer. Could anyone
show me vb.net codes to solve this problem? Tag: Handling ListView Click and DoubleClick Tag: 60865
Event Order
Hi there,
I was wondering how the SelectedIndexChanged event can fire in a ListView
control before the Leave event fires in the previous control that is losing
focus? Is this the designed behavior? I really need to be able to handle the
Leave event first and seeing validation events fire AFTER leave, it seems
that no events should fire in the list view until after the Leave even (and
validation events if not suppressed).
Kind Regards,
Wayne Hartell Tag: Handling ListView Click and DoubleClick Tag: 60862
Pocket PC App with mulitple Forms
I'm developing a Pocket PC Application comprised of
multiple WinForms. When I perform the following
function, I noticed that my Application appears multiple
times in the Pocket PC Task Manager. If you happen to
select the wrong Application, it brings up the Parent
form and not the Dialog. Is there any way to correct
this problem so that my Application only appears once in
the Task Manager? Do I possibly have some parameters
setup incorrectly for the parent or child forms?
Here is the simple code I'm using to display a dialog.
private void button1_Click(object sender,
System.EventArgs e)
{
MyDialog dlg = new MyDialog();
DialogResult Result = dlg.ShowDialog();
}
Of course, if MyDialog also pops up another WinForm, then
the problem gets even more complicated.
=======
-F Tag: Handling ListView Click and DoubleClick Tag: 60857
is possible to edit/replace an embbebed resource file after compile a file?
I have a grid layout embbebed when compiled, in runtime after compile the
program, I need to change something, I can extract the file to get the
properties, but can I edit and replace the file at runtime and update the
resource in the compiled file?
thanks aM Tag: Handling ListView Click and DoubleClick Tag: 60854
Locking the Keyboard & Mouse in VB.NET
I am trying to Lock the Keyboard/Mouse under VB.Net. I
am building an application where a workstation needs to
be unusable at certain periods of time.
There are two great articles on Locking/Unlocking the
keybaord/mouse in VB.NET:
http://www.codeguru.com/vb_system/PK041803.html
and
http://www.devcity.net/forums/topic.asp?
tid=25063&#RID75038
Both articles try to install a low level hook that
consumes keyboard/mouse events. Niether of these seem to
work when invoked as a background thread or as a console
application.
This approach used to work a few months ago (Unless my
memory is already going bad), but now, windows does
something wierd and kicks out the low level Hook. I am
wondering if one of thoes many security patches has made
hooks work differently?
If you try this code as a VB Windows application and tie
it to a button, it works. If you build this code under a
VB.Console application, it fails.
Does anyone have a suggestion/idea on how to lock the
Keyboard/Mouse as a VB.NET console application?
g. Tag: Handling ListView Click and DoubleClick Tag: 60846
how does MessageBox work?
Hi!
I'm trying to make my own MessageBox... What I would like to know is, how
the MessageBox class is implemented?
I could have something like:
new MyMessageBox().ShowDialog();
but I would like the solution used by MessageBox, where you call the static
Show() method, which
returns a DialogResult value...
a few tips on how to create that would be really appreciated!
Thanks,
saso Tag: Handling ListView Click and DoubleClick Tag: 60841
Inter op between C# and VB
Hi..
Does anyone have a idea of how to integrate between C# and VB.. I have a
project developed in VB.NET.. and a few other developers are doing
additional screens in C#. How do I integrate the C# forms into VB?
Vijay Tag: Handling ListView Click and DoubleClick Tag: 60837
How to set a file for printing?
Hello,
I need to set programatically the target file or PRN file and PrintToFile
option for printing within a .NET application. Does anybody know how to do
it? No matter if the code results "unsafe" or any Windows/COM object must
be used, just any solution.
I want to avoid being asked for the output file everytime I accept on the
common PrintDialog after checking the PrintToFile option during a file
printing bunch process.
Thanks in advance,
Yurai Tag: Handling ListView Click and DoubleClick Tag: 60836
Debugging not working as requested
In a VB.NET 2003 Windows Forms application, I get all the time the Unheld
Exception Dialog, without any option to debug (just continue or exit).
I have set jitDebugging to true, both app.config and machine.config, turned
off/on the computer, but the program does not stop and allow me to debug,
unless I manually enforce a breaking point.
Any suggestions? Tag: Handling ListView Click and DoubleClick Tag: 60832
doc-view support in .Net framework with C#
I would rewrite an old doc-view MFC application with C#.
Looks like C# only supports Windows form based
application. Do I miss something? If I really want to
create doc-view application with C#, how can I do it and
where can I find the sample code?
Thanks a lot,
-JohnSun Tag: Handling ListView Click and DoubleClick Tag: 60831
Need Input for New Community College .NET Certificate Program
I am a full time computer science instructor at Raritan Valley
Community College in New Jersey. I'm currently developing a
Microsoft.NET certificate program.
In order to create a program that best meets the needs of the
community, I have developed an online survey in the hopes that .NET
users will offer input regarding the certificate's contents.
If you would be willing to fill out the survey, it can be found at
http://www.stevejays.com (Sometimes the load time is a little greater
than normal)
Names/addresses will not be shared, just the aggregate demographic
information.
Thank you in advance,
Steve Schwarz Tag: Handling ListView Click and DoubleClick Tag: 60830
Active bug in datagrid? Application slows down after a few hours
Hello,
I have a winforms application which, after a few hours of use, seems
to get slower and slower. I am using a datagrid and loading different
data (10 columns, 15 rows) on average about every minute. I made sure
that I am setting the datasource to nothing after I clear it before
going for more data. I also call the garbage collector after clearing
the data as well. The memory usage for this app never goes up too much
so I'm pretty sure I don't have a memory leak. After a couple of hours,
any action on the datagrid can take up to 30 seconds.
In searching for possible solutions, I came across this article from the
microsoft.public.dotnet.framework.windowsforms newsgroup:
http://www.dotnet247.com/247reference/msgs/10/51621.aspx
most notably the lines:
"Thanks for reporting this problem. There is an active bug that has the
same performance symptoms it may be related. The other bug is related to
master-
detail DataGrids in Windows Forms but has a memory leak also. Your bug
may be related but I'm not sure of the scenario."
and wonder if someone here has a link to more information on this 'bug'
so I can see if it applies to my application. I sure am frustrated and
would like to find a fix or patch to this asap. Thanks,
-Ringo at ringosoft dot com Tag: Handling ListView Click and DoubleClick Tag: 60829
Datagrid and focus confusion
Hi,
I'm trying to implement a ComboBox drop-down column for a DataGrid.
When a cell is selected in the ComboBox column I overlay a ComboBox
over the cell and call:
this.comboBox.Show();
this.comboBox.BringToFront();
this.comboBox.Focus();
Now when I press the up/down arrow keys I would expect the ComboBox
to respond to those keyboard inputs because it has the focus. But
it doesn't. Somehow the DataGrid gets the key strokes and causes
the next row in the DataGrid to be selected.
Why would this be? I'm positive the ComboBox has the focus. I
added event handlers for the DataGrid enter/leave, and the ComboBox
enter/leave events and I only see the ComboBox ones getting called.
This is really annoying. The only workaround I've found is to
derive a class from ComboBox that overrides the WndProc and
ProcessCmdKey methods and catches the keystrokes and tries to
do the correct thing. But this has problems because then I have
to catch everything (Enter, Tab, Shift-tab, Left, Right, etc.).
Now I'm having a problem processing Enter correctly. When the
ComboBox drop down list is displayed I can now go up and down
the list using the arrow keys but the only way I can correctly
select one is with the mouse. When I try to use the enter key
nothing happens because I've overridden its behavior and I'm
not sure what methods to call to make it work correctly (i.e.
commit the current choice and collapse the menu again).
I don't understand why the ComboBox isn't handling these things
automatically if it has the focus.
Any help appreciated. Thanks,
Bill Tag: Handling ListView Click and DoubleClick Tag: 60824
In .NET - How to get name of MQ.Service on local machine
Hello everyone,
I am using "MQ.dll" which is supposed to be written
in .NET. My question is how do I get name of the
MQSeries.Service on the local machine. What I want to do
is mimmic what the MQ Series Explorer does!i.e. list all
of the Queue Managers on the local machine and then when a
user clicks on a Queue Manager I want to populate another
list box with the Queues. Any help pointing me at the
right objects or methods would be helpful!!
Thank You in advance for Your Help,
Ken Tag: Handling ListView Click and DoubleClick Tag: 60823
Complete removal of app
I have a windows forms app that, on occasion, I release updated versions.
Recently I did this but when one of the users attempts to access a specific
part of the app, they get an error message. I run the app on my development
machine and it works fine.
I rebuilt the installer files and attempted to install it again, but with
the same error. I use the same install files to install onto a fresh
machine at the clients place, and again it works perfectly.
I'm thinking that somehow the installation files on the original update had
got slightly corrupted but now, even if I use Add/Remove programs to
uninstall from the users machine, he still gets the same error after
reinstallation.
Does anyone have any idea on ways around this one? Is there something I
need to do after using Add/Remove programs to ensure that it has been
COMPLETELY uninstalled?
--
Rob Oldfield
www.realuk.co.uk Tag: Handling ListView Click and DoubleClick Tag: 60819
Databinding textboxes
Hi all,
Just a newbie, but wondering if when you bind a textbox
text property to a column in a datatable (in a dtatset),
do you have to code your own updating to the datatable or
is it done automatically like the datagrid control?
TIA
Travis Tag: Handling ListView Click and DoubleClick Tag: 60811
File IO speed problem
I always find that when there is a write operation immediately after the
read operation, it throws this exception
An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll
Additional information: The process cannot access the file
"D:\Projects\pro.dat" because it is being used by another process.
how to solve this problem Tag: Handling ListView Click and DoubleClick Tag: 60800
DataGrid Formatting Question
I have a DataGrid control that I populate by binding it to an ArrayList.
The ArrayList contains objects of a class I created with several public
properties exposed to populate the respective columns.
I have two questions regarding this DataGrid control:
1.) There is an automatically-generated column along the left-hand side of
the DataGrid which is apparently provided to enable row selection. It
contains a little triangle to mark the currently-selected row. How can I
control the width of that column? (I don't know if it is even called a
"column", but I don't know what else to call it.)
2.) I am doing all formatting programmatically by creating a
DataGridTableStyle then creating each column respectively via
DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
font for the Header in this scenario (ts.HeaderFont), I have not found a way
to set the font for normal rows? If I try to set the font via the
DataGrid.Font property (after the above DataGridTableStyle is set), my font
specification seems to be outright ignored. How should I do this?
Cheers, Bruce Tag: Handling ListView Click and DoubleClick Tag: 60798
Print preview
I all!
I want to use a ListView control together with PictureBox
in the same form. The latter is for preview purposes
(before printing) of data displayed in the former.
How can I do it??? Tag: Handling ListView Click and DoubleClick Tag: 60797
file upload is not as easy as expected for ".NET"...
hi all
from a environment named ".net" I expected that doing a file upload from a
winforms app to a web server (either a Web Service or a ASP.NET page) should
be pretty simple.
however I searched the web and it is plenty of documentation about how to do
it from a web page but not from a winforms app. form a web page seems to be
simpler because the asp code behind actually runs at the server.
does anybody out there has any piece of code to share with me that shows at
the winforms client side and at the web server side (either asp.net or
webservice) how to do a file upload ?
thanks in advance,
ant. Tag: Handling ListView Click and DoubleClick Tag: 60794
XP-style explorer icons?
Hi all,
Can anybody tell me where I can get the Windows explorer
XP-style folder icons, in both their open and closed
states?
Note, that I'm after the XP-style ones, which are subtly
different to the older style ones (which come with the
SDK in the Common/Graphics... folder).
Any help is very appreciated!
dm.
morris_dominic
@
h o t m a i l
dot
com Tag: Handling ListView Click and DoubleClick Tag: 60787
Is it possible to create custom from designs?
By that i meen not using the standard form look, but rather a more
sophisticated GUI wich not necesarly is made of a square , but maybe a oval,
or a circle?
Thx in regards
Anders Tag: Handling ListView Click and DoubleClick Tag: 60786
can we use notifications in a disconnected environment ?
hi all !!!
I would like to use notifications (like MSN or Messenger alerts) in a
WinForms applicacion that will run at an isolated PC not connected to the
Internet.
is this possible ? if it is, which controls or objects should I use ?
thanks in advance,
ant.
PS: crossposting to winforms and wincontrols newsgroups because it applies. Tag: Handling ListView Click and DoubleClick Tag: 60781
Windows Media Player 9 ActiveX control
Hi, I have written a piece of software that allows me to show a video stream
from certain websites in my application (the video stream is .asx format).
Although this works fine on my machine (directly connected via ADSL to the
net), when I try it on other machines on my network, it just won't work.
I have a proxy on my machine (netnow), which allows all the other machines
to use the net. I noticed in the WMSDK that there is a setProxySettings
method, so I used it like this ...
try
{
wmp1.network.setProxySettings("HTTP",2);
}
catch (Exception e)
{
MessageBox.Show("Error setting up the proxy details");
}
Yet it always pops up the message box ! I have also tried different values
for the second parameter with no luck.
Now, I'm not sure, but I have the feeling that the first parameter is
incorrect. I am trying to play a stream (live), so possibly it should be
some kind of streaming protocol?
Any help would be gratefully received.
TIA
John Young Tag: Handling ListView Click and DoubleClick Tag: 60780
Setting the PaperSize
Hi,
I'm having a weird problem setting up the paper size in a C# Windows Forms
Application.
The code I'm using is something like this:
PrintDocument pd = new PrintDocument();
pd.DefaultPageSettings.Margins.Left = 0;
pd.DefaultPageSettings.Margins.Right = 0;
pd.DefaultPageSettings.Margins.Top = 0;
pd.DefaultPageSettings.Margins.Bottom = 0;
PaperSize pkCustomSize1 = new PaperSize("First custom size", 827, 100);
pd.DefaultPageSettings.PaperSize = pkCustomSize1; //** This line works...
pd.PrinterSettings.DefaultPageSettings.PaperSize = pkCustomSize1; // This
doesn't...
What I get after all this, is just an A4 page that is only written on top...
:-(
How do I tell my application which size I want the paper to be?
Thanks in advance,
Pedro Feio Tag: Handling ListView Click and DoubleClick Tag: 60778
Disabled MenuItem, how to draw ?
I have my own class ImageMenuItem and
I have no idea how to draw (Enabled == false) menuitem.
Gawel Tag: Handling ListView Click and DoubleClick Tag: 60777
Datagrid to sql database
How can I put everything that is in a datagrid into a SQL server database
(which should be readable by an PocketPC program)?
There is probably a simple solution for it, but as always it is difficult to
find it in the jungle of MSDN.
thanks!
Eric Tag: Handling ListView Click and DoubleClick Tag: 60776
BUG: Printing Problem
Hi,
I am working on the PrintDocument, PrintDialog, PageSetupDialog and
PrintPreviewControl components of Visual Studio .NET 2003. My developement
machine is running Windows XP.
There are some problems I encountered while using them. Please note that,
the Regional and Language setting on my machine is using "Metric"
measurement system (where the default is "US"). In this case, the
measurement unit is "milimeters" and not "inches".
PROBLEM #1
``````````````
The first problem is with PageSetupDialog. The following code,
Dim pagesettings As System.Drawing.Printing.PageSettings
Dim pagesetupdialog As System.Windows.Forms.PageSetupDialog
pagesettings = New System.Drawing.Printing.PageSettings
With pagesettings.Margins
.Left = 100
.Right = 100
.Top = 100
.Bottom = 100
End With
pagesetupdialog = New System.Windows.Forms.PageSetupDialog
With pagesetupdialog
.PageSettings = pagesettings
.ShowDialog()
End With
' Values printed out are not the same as entered
With pagesettings.Margins
Console.WriteLine(.Left)
Console.WriteLine(.Right)
Console.WriteLine(.Top)
Console.WriteLine(.Bottom)
End With
will reproduce the problem I'm facing.
Before calling the ShowDialog() method of the PageSetupDialog component, I
have already set the Margins to 100. Although my OS's measurement system is
set to "Metric", Visual Studio .NET still uses inches (0.01 in) for it's
measurement unit. In my case, the Margins are set to 1 inch.
On calling the ShowDialog() method, what you see is the margins are all set
to 10 (and the unit is milimeters). On clicking the OK button, the
PageSetupDialog component will convert the value entered in it's dialog to
inches (0.01 in). As the result, the margins after the ShowDialog() is
called are changed to 39 (100/2.54=39.xxxxxx).
This surely is a BUG (or am I missing something here).
I have a solution for this problem and the code is as below.
Dim pagesettings As System.Drawing.Printing.PageSettings
Dim pagesetupdialog As System.Windows.Forms.PageSetupDialog
pagesettings = New System.Drawing.Printing.PageSettings
With pagesettings.Margins
.Left = 100
.Right = 100
.Top = 100
.Bottom = 100
End With
pagesetupdialog = New System.Windows.Forms.PageSetupDialog
With pagesetupdialog
.PageSettings = pagesettings
' Keep the original setting
Dim marginSaved As System.Drawing.Printing.Margins
marginSaved = pagesettings.Margins
' Convert to milimeters
pagesettings.Margins =
System.Drawing.Printing.PrinterUnitConvert.Convert(pagesettings.Margins,
System.Drawing.Printing.PrinterUnit.Display,
System.Drawing.Printing.PrinterUnit.TenthsOfAMillimeter)
' Show the page setup dialog
If .ShowDialog() = DialogResult.Cancel Then
' If user clicked Cancel, restore the saved margin
pagesettings.Margins = marginSaved
End If
End With
With pagesettings.Margins
Console.WriteLine(.Left)
Console.WriteLine(.Right)
Console.WriteLine(.Top)
Console.WriteLine(.Bottom)
End With
But there is a problem with it. The conversion between milimeters and inches
causes the measurement to be inaccurate.
PROBLEM #2
``````````
The OriginAtMargins property of the PrintDocument component does not work
properly when the PrintDocument is added into the PrintPreviewControl.
Setting the value to True does not effect the preview shown by
PrintPreviewControl but the printed result is correct.
PROBLEM #3
``````````
When handling the PrintPage event of the PrintDocument, if the
OriginAtMargins of the PrintDocument is set to True and I set,
e.Graphics.PageUnit = GraphicsUnit.Millimeter
then the top margin is measured as milimeters while the left margin is
measured as inches.
The problem discuss above might not be bugs but I have checked the MSDN
library but it does not seem to help much. Any help is really appreciated.
Thanks in advance. Tag: Handling ListView Click and DoubleClick Tag: 60772
DataGrid Scrollbar problem
I've a problem using a datagird, for some reason I keep getting the scroll
bars of the datagrid on top of the grid itself.
Moreover, the window is big enough that I don't need the scrollbars.
It's kind of hard to explain, please look here for example:
http://ayende.freewebspace.com/bad%20datagrid.JPG
This is where I create the tab pages, FillDataTable() fills the datagrid
with rows.
The code that I'm using is:
tp = new TabPage(q.Name);
dg = new DataGrid();
dg.BeginInit();
dg.SuspendLayout();
dg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
dg.HeaderForeColor = System.Drawing.SystemColors.ControlText;
dg.Location = new System.Drawing.Point(8, 8);
dg.Name = q.Name;
dg.Dock = DockStyle.Fill;
dt = new DataTable(q.Name);
Name = new DataColumn("Name",Type.GetType("System.String"));
Value = new DataColumn("Value",Type.GetType("System.String"));
dt.Columns.AddRange(new DataColumn[]{Name,Value});
FillDataTable(dt,q);
dg.DataSource = dt;
dg.ReadOnly = true;
dg.PreferredColumnWidth = 150;
dg.AllowSorting = false;
dg.CaptionText = q.Name;
dg.ColumnHeadersVisible = false;
dg.RowHeadersVisible = false;
dg.ResumeLayout();
dg.EndInit();
tp.Controls.Add(dg);
QuotesTab.TabPages.Add(tp);
P.S.
How do I make the columns spread on all the screen?
(Actually, I just want the second column to do that.) Tag: Handling ListView Click and DoubleClick Tag: 60769
HitTestInfo Returning Wrong Column
I've been working with the hittestinfo class in my application trying to
determine what column my user has clicked. Everything works fine so long as
the columns are set to their default 75 pixel width. When I change the width
of the column either in my columnstyle or in the datagrid control at
runtime, the incorrect column is being returned.
here's the code...
Dim tempGrid as DataGrid = DirectCast(sender, DataGrid)
'--- Select the whole row when the user clicks in the cell area ---'
Dim pt as New Point(e.X, e.Y)
Dim ht as DataGrid.HitTestInfo = Me.grdPoItems.HiTest(pt)
If ((ht.Row > -1) AndAlso (ht.Column > -1)) Then
MessageBox.Show(cstr(ht.Column))
End If
I have this placed inside a DataGrid.MouseUp event handler.
I'm working with VS 2003, Framework 1.1, No SP's installed.
Has anyone else seen this behavior?
jim Tag: Handling ListView Click and DoubleClick Tag: 60765
Extending "Save As" Dialog
My question is:
How can i extend the "Save As" Dialog. For example if i
am working in Word and i want to save my document in my
new app, i want to select "save as" and i want my app to
be shown in the options.
I hope to be clear.
Thanks. Tag: Handling ListView Click and DoubleClick Tag: 60758
printer share name
i am held up.. please help me
i have installed one network printer on my system and
through c# program i want to get the share name of that
printer.. the printer is installed on another machine and
is shared.. can anybody help me? Tag: Handling ListView Click and DoubleClick Tag: 60757
Form.Container property
Hello,
When I put components on a form the designer appears to package them up
nicely in a container component.
Does the inherited System.Windows.Forms.Form read-only Container property
give access to these components?
If not, how can I access a form's component list given only a reference to
the form "As Form" ?
Thanks for any help
Jon Tag: Handling ListView Click and DoubleClick Tag: 60756
Removing Excel.exe from memory
This seems to be a topic that has been discussed at length in newsgroups,
but I still can't get it to behave...
I'm using automation to get at an existing Excel spreadsheet and then
retrieve data from it. I then want to close down the Excel process. What
I'm getting though, is the process remaining in memory until my app shuts
down.
I am, by the way, aware that MS article 257819 is a better method of getting
at the data, but sadly the spreadsheets that I'm working with are created by
another piece of software and they're just not quite right. The ADO
approach doesn't work with them.
My code (referencing MS article 317109 and numerous newsgroup postings) -
just a sample to simply open Excel and the file, and then to shut it
down....the form will need a reference to the Excel object library.....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'Open the file
Dim file As String = "c:\data\vs\test.xls"
Cursor.Current = Cursors.WaitCursor
Dim objExcel As Excel.Application
Dim Books As Excel.Workbooks
Dim Book As Excel.Workbook
Dim Sheet As Excel.Worksheet
objExcel = New Excel.Application()
Books = objExcel.Workbooks
Book = Books.Open(file)
Sheet = Book.Worksheets(1)
Sheet.Unprotect()
'...and then attempt to close it
Dim objEachWorkSheet As Excel.Worksheet
Dim objEachWorkBook As Excel.Workbook
For Each objEachWorkBook In objExcel.Workbooks
For Each objEachWorkSheet In objEachWorkBook.Worksheets
NAR(CObj(objEachWorkSheet))
Next
objEachWorkBook.Close(False)
NAR(CObj(objEachWorkBook))
Next
NAR(objExcel.Workbooks)
objExcel.Quit()
NAR(CObj(objExcel))
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
Cursor.Current = Cursors.Default
End Sub
Private Sub NAR(ByVal o As Object)
Try
Dim i As Integer
Do
i = System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Loop While i > 0
Catch excpUnexpected As Exception
MsgBox(excpUnexpected.ToString())
Finally
o = Nothing
End Try
End Sub
Anyone have a method of putting the Excel process out of it's misery?
--
For real reply address, lose the cash
www.realuk.co.uk Tag: Handling ListView Click and DoubleClick Tag: 60755
center the font in a tab control?
Hi there,
is there any possibility to center the titles in a tabcontrol object?
Normaly the font is alligned to the left hand side by default.
THX Tag: Handling ListView Click and DoubleClick Tag: 60753
How to determine average character width for a font?
Does anyone know how to determine what the average width of a character is
for a font?
The reason I want to know is that I want to use it to size my text boxes.
For example, if I know that a text box will always accept 8 characters, I
want to size the text box so that it is roughly the size that will display 8
characters.
Jon Tag: Handling ListView Click and DoubleClick Tag: 60745
Setting permissions for limited user accounts
Hi All,
I have two questions related to permissions which is going to cause me to
lose my last piece of hair on top of my head. I am using VS2003 on XP Pro
with Framework 1.1
1. The windows app creates registry keys during the install. However, when
users with limited rights access the application it raises the Access to
registry key is denied error. The user can go into these registry keys by
using regedit. Besides, while executing these code lines, the assembly
requests the registry access rights by using System.Security.Permissions.
Well, it doesn't work unless the admin goes to registry and right clicks on
the associated registry key to give full permission to the machine users. If
this is my only option, then how can I do this programmaticaly?
2. Setup places a folder and several files for shared access from this
folder. This folder also needs to grant access to users. How can I do this
programmaticaly?
Thank you very much for your help.
Korhan Tag: Handling ListView Click and DoubleClick Tag: 60742
Problem with Form.BindContext().Position
I have a form with a DataGrid with AllowSorting property
sets true.
I am usually using the form.DataBinding
(DataSet,DataMember).Position as the index when I need get
the match data from the DataSet, but when I click on the
header column to sort the rows, the Position porperty is
changed to a value different from index.
The question is, how can I get the corret row in dataset
using the Form.BindingContext's properties with the
DataGrid's AllowSorting set True?
Best regards,
Mauricio (Brazil) Tag: Handling ListView Click and DoubleClick Tag: 60725
Is this a datagrid/combo bug???
Hi
I have a form with a combo and a datagrid
The combo has these properties:
Datasource: DataSet11.tPersoner
Displaymember: ChristianName
It does not have any databindings
The datagrid has these properties:
Dim dv As DataView = DataSet11.tPersoner.DefaultView
DataGrid1.DataSource = dv
Because I want different bindingmanagers for the two controls.
Now when I change the current cell in the datagrid (by clicking with the
mouse) they are not synchronized (which I don´t want them to be). But if I
sort the datagrid by clicking on a column header suddenly the combo shows
the ChristianName of an (appearantly random) row in the datagrid.
(I have created two different CurrencyManagers for the controls. And they
are not synchronized. their .Position are not the same)
It seems strange to me.
Any explanations?
best regards
Jan Tag: Handling ListView Click and DoubleClick Tag: 60722
Control size BUG! URGENT
Hi there,
I think I found a critical bug in Studio .net 2003.
Try this,
Create a Form.
Create a Panel within the Form.
Create a Button within the Panel.
Now set the Button's Location.Y property to a value that it becomes above
the panel's visible area, for example, set Location.Y to -300. Now run the
program, close it again and then check Button's Size.Height value. It is now
bigger one pixel than before. It also happens if you do the same thing to
Location.X property.
Can you tell me how to correct this bug? I tried to create a component that
implements IExtenderProvider to change control's height to less one pixel
everytime it goes to designmode but I can't find a event that is raised when
this happens.
I need this because I want to create a visual control like the
Explorer-style tab that you can found on the left side of a folder browsing
window. All controls inside the tab come from above, so I have to set the
Anchor property to (Left or Bottom).
It's very important for me, please reply as soon as possible.
Thanks,
Filipe Freire Tag: Handling ListView Click and DoubleClick Tag: 60721
Can't reference control(s) outside groupbox
I can't access any properties of controls outside a
groupbox when handling events of controls belonging to
this groupbox.
Any suggestions? Tag: Handling ListView Click and DoubleClick Tag: 60720
'System.NullReferenceException' not breaking in MDI ChildForm
I am developing some forms that use multiple accessors to
get information from within user created controls.
MainForm is Parent
JobForm is a MDI child
It has a user Control called MaterialControl
Eg.
MaterialControl has an accessor JobinProgress
Which Accesses a Job Class, which in Turn Access a
Materials class which in Turn accesses the AddMaterial
Method
Eg:
JobinProcess.Job.Materials.AddMaterial
JobinProcess has accessor to Job
Job has an accessor to Materials
Materials has the Actual Method.
My problem is when I do not have something initialized
properly during development and one of these accessors
contains a null value.
During debu