|
Johnkokk wrote: Is this normal ?
No, unless you included code to that effect.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Note that when i test run my app, i do it through the IDE.
Here are the steps, so that you can understand better.
1.Write some VB. net code.
2.Run through IDE
3.Insert data to database through my app
4.Find a bug
5.Stop the execution
6.Correct the bug
7.Re run the app through the IDE
Data that i inserted on step 3, are deleted and Database is empty.
If i open the database with MS ACCESS, fill some data there and run it from my app, everything is OK.
|
|
|
|
|
In Solution Explorer Window click your database file node (the one with the little golden cylinder icon) then hit F4.
Is 'Copy To Output Directory' set to 'Copy Always' (I think this is the default). If so, change it to 'Copy if Newer' or 'Never' once you understand what they mean.
I have been caught by this when I first started. What happens by default is that each time you run the app VS copies your empty database to your output directory, overwriting your nice data filled one.
'Copy if Newer' only does so if you change the DB in some way, so you need to take steps to protect the data you have entered.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
That makes perfect sense.
Putting data files in a Visual Studio folder is something I like to avoid.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Yep.
Unfortunately, a couple of the MSDN HOWTO:s/WALKTHROUGH:s tell you to do it that way. Project|Add Item|Database.........
It usually mentions (or links to a page that does) the 'Copy Always' problem but it is well hidden.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Yeap, that was it.The "Copy always" thing.
I knew it was not "normal".
Thanks people.
|
|
|
|
|
Is there a way to set the printer output bin in .NET? It seems to be missing from the settings.
|
|
|
|
|
how can i code voice record with c# languge
|
|
|
|
|
sura945 wrote: how can i code voice record with c# languge
By programming the required functions. You might want to start with doing some research. There's a component on CodeProject[^] that can record sound.
HTH
I are Troll
|
|
|
|
|
hi
i have an idea on strong names
but i want in detail that are there any disadvantages in using strong names in my application.
Can u briefly explain me the concept that will be more helpful for me
thank you
|
|
|
|
|
Here[^]
only two letters away from being an asset
|
|
|
|
|
Hi All,
How can I raise/mimic Menu click event from some other control's(TextBox) event(TextChanged).
Actually I want to see Menu rolldown on event of text change in TextBox.
Can anyone please help?
Thanks in Advance,
Vipul
|
|
|
|
|
First identify the environment, Windows or Web?
only two letters away from being an asset
|
|
|
|
|
I want to implement in WinForms.
Thanks,
Vipul
|
|
|
|
|
I got the answer.
Its ToolStripMenuItem.ShowDropDown() function. That was easy
Thanks,
Vipul
|
|
|
|
|
I want to add text to a transparent bitmap (in C# 2.0). The text can be black, white, or red. But it seems that when I use the DrawString method of the Graphics object it antialias the text with black. This works okay when I have white or red text and the transparent bitmap is shown over a mainly black background, but looks crap when I have black or red text and the transparent bitmap is shown over a mainly white background. (White text looks blurred, red text has black bits round edges.)
Does anyone know how to antialias to white on a transparent graphic? Or antialias to transparent properly?
(I have tried setting the bitmap to white first. Then after the text has been added, floodfilling back to transparent. Sort of works except all the closed loops in letters like o, d, b, p ... etc.)
|
|
|
|
|
I found this[^], which seems to have some work arounds, from a quick google on c# antialias problems
The link above is from fairly near the top of a loooooong list.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I don't think it's possible to generate a semi-transparent bitmap with a single alpha value per pixel which will properly render ClearType text against arbitrarily-colored backgrounds (when drawing yellow text on a black background, a particular pixel may have to be red, but when drawing on a white background it may have to be yellow).
If one refrains from ClearType-style use of colors for sub-pixel addressing, one could generate a bitmap that would depict a nicely anti-aliased font when overlaid on any background, by setting the color of any area of the bitmap which touched the letters to the font color, and varying the alpha to properly soften the edges. I don't think that's what Microsoft does, though.
Still, you might want to experiment some with the property (I forget what it's called) that switches between drawing using an alpha value, or copying an alpha value to drawn pixels).
It would be nice if there were a way of restricting drawing operations to either act only on the alpha channel, or leave the alpha channel alone while acting on color. I'm unaware of how to do those things, though.
|
|
|
|
|
Okay. After playing around with a number of options without luck I decided to try a completely different approach. What I did was to create a second (temporary) bitmap with the same dimensions as the transparent target but with a white background. I then wrote on it in black. Finally I merged this into the transparent bitmap by examing each pixel in my second bitmap and setting the corresponding pixel in the target with RGB set to the target colour and the 'A' byte set to 255 - ((old R + old G + old B) / 3). Surprisingly, this worked and gives me true antialias to transparent.
If anyone's interested I've posted the code here [^]
|
|
|
|
|
Hi
I found an issue in reading files.
My code is simple:
fFile = New System.IO.FileStream("somefile", IO.FileMode.Open, IO.FileAccess.Read)
where "somefile" is file, which is in use with another application.
When I try to execute this line I will get an error: "The process cannot access the file 'sometext' because it is being used by another process".
Notepad can open this file without problem, Wordpad can not.
Can someone explain me, how notepad reading files? Can I use this method of file reading in .NET VB, or WIN32 API ?
|
|
|
|
|
SOLVED:
fFile = New System.IO.FileStream(sFileName, IO.FileMode.Open, IO.FileAccess.Read, FileShare.ReadWrite)
FileShare.ReadWrite means I allow write access to application which is using file.
|
|
|
|
|
Hi,
I want to execute mousehover event when user pressed left mouse buttion and drag on labels.
I have added 30 labels programatically and i want to change backcolor of labels when user clicks on particular label or user click on label and drag in other labels with left buttion pressed.
Ex.: Sinerio like when we select mutiple files in explore, we pressed left buttion and drag on files they get selected.
Main problem is when we pressed left key and drag on other labels then mouseover or other evnts are not executed i.e. main problem.
Without pressed mouse left button mouseover or other events are executed. how to execute events when left buttion is pressed and drag on other labels.
Thanks
Sanjay
|
|
|
|
|
hi
how I can use / insted of . for decimal number in textbox and datagridview?
|
|
|
|
|
Simple.
If the number is 123.4 , simply type 123/4 . Problem solved.
Perhaps, if you explain what it is that you are trying to do (i.e. why you need to do this, and what you want to do with the data) it might make it easier for people to give a sensible answer.
[Edit]
Fixed a typo
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Wednesday, October 28, 2009 10:39 AM
|
|
|
|
|
Hi,
have a look at the NumberFormatInfo type. You probably want to set NumberFormatInfo.NumberDecimalSeparator and use the NFI in all relevant numeric input (Parse/TryParse) and output (ToString).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|