|
There is no easy way to do the conversion. You need to look at the code and write it in C#. All the forms has to be redesigned.
|
|
|
|
|
Ya, but how do I look into the code? The menu & designer buttons are not there.
Everything makes sense in someone's mind
|
|
|
|
|
Use mssql managerment stdio.
Choose "Import Data".
Find your mdb file.
Then it'll be taken by itself.
|
|
|
|
|
KMAROIS wrote: The only file they gave me was an .MDB file. Is there more?
Possible that there is a .MDW file that you need - this contains user/group data for security purposes. IIRC the default is System.MDW.
IIRC there are some settings that disable menu options but if you hold down Ctrl when opening the mdb these are ignored. (It's a long time since I did Access stuff so it might be Shift not Ctrl - there's definitely a way to do it though.)
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Thanks. I'll give it a try
Everything makes sense in someone's mind
|
|
|
|
|
He's right; there's some code that is run when you open the database. That code hide's the menu's and stuff. Hold down the shift-key to open it in design-mode
I are Troll
|
|
|
|
|
Hello,
I created a typed dataset and it's work greate when i insert a new column,
but when i'm trying to update an exist data i get this -
System.InvalidOperationException was unhandled
Message="Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
Source="UpdateDataBase"
What i'm doing wrong???
|
|
|
|
|
tamir901 wrote: What i'm doing wrong???
At a guess, you are failing to supply a valid UpdateCommand.
More than that it is difficult to say without seeing the update code you are using.
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.”
|
|
|
|
|
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
g.FillEllipse(Brushes.Red,
new Rectangle(e.X,e.Y,20,20));
}
Why do I get a funny location that is far from the mouse position and not even fixed!! It gets before and after the cursor position as I move!
Please help.
|
|
|
|
|
I see no humor in this
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: I see no humor in this
Now THAT was funny!
In my post, by funny I meant strange.. You knew that.
|
|
|
|
|
The active pixel of the cursor by default is the top left of the cursor rectangle IIRC. I'm not sure if this can be changed (I think it can but I can't remember how).
This will centre your line at the cursor point.
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
int widthHeight = 20;
using (Graphics g = this.CreateGraphics())
{
g.FillEllipse(Brushes.Red, new Rectangle(
e.X - (widthHeight / 2),
e.Y - (widthHeight / 2),
widthHeight,
widthHeight));
}
} [Edit] Just checked and the 'hot spot' pixel is set in the cursor file itself. I just downloaded this[^] to try it! [/Edit]
modified on Monday, October 5, 2009 4:29 PM
|
|
|
|
|
|
No problem
|
|
|
|
|
Wait
Actually, when applying your code to the form it works like a charm, but when doing the same to a pictureBox control, the same problem persists..
private void pbPreview_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
int HW = 20;
Bitmap b = (Bitmap)pbPreview.Image.Clone();
Graphics g = Graphics.FromImage(b);
g.FillEllipse(Brushes.Violet,
new Rectangle(
e.X - (HW / 2),
e.Y - (HW / 2),
HW,HW));
pbPreview.Image = (Image)b;
}
}
I tried using the HotSpot as you said but it's somehow a static point! I also tried this in the pain event handler of the pictureBox
private void pbPreview_Paint(object sender, PaintEventArgs e)
{
int HW = 20;
Graphics g = e.Graphics;
g.FillEllipse(Brushes.Yellow,
new Rectangle(
this.Cursor.HotSpot.X,
this.Cursor.HotSpot.Y,
HW, HW));
}
Please Dave, let me know if you still have a trick up your sleeve
|
|
|
|
|
your mouse pos is always relative to something. You need to work out what it's relative to, and what you want it to be relative to. I'd guess you need to just subtract the top left corner of the picturebox, and that you're getting co-ordinates on the form. However, there are ClientToScreen and ScreenToClient type methods on your controls which you can use.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: mouse pos is always relative to something...
subtract the top left corner of the picturebox...
Exactly my thought but I was disappointed when it didn't work
Christian Graus wrote: there are ClientToScreen and ScreenToClient type methods on your controls which you can use.
I will give them a try, thank you for your time Christian..
|
|
|
|
|
This works for me - all I've done is call pictureBox1.CreateGraphics instead.
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
int widthHeight = 20;
using (Graphics g = pictureBox1.CreateGraphics())
{
g.FillEllipse(Brushes.Red, new Rectangle(
e.X - (widthHeight / 2),
e.Y - (widthHeight / 2),
widthHeight,
widthHeight));
}
}
|
|
|
|
|
Thank you Dave!! Man you are amazing
|
|
|
|
|
This is an improved implementation that does what you want by creating a custom picture box. There's still some stuff to do, such as validating the value of LineWidth etc but should help.
public class DrawablePictureBox : PictureBox
{
private List<Rectangle> rectangles = new List<Rectangle>(100);
public DrawablePictureBox()
{
LineWidth = 20;
LineColor = Color.Red;
}
public int LineWidth
{
get;
set;
}
public Color LineColor
{
get;
set;
}
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (e.Button == MouseButtons.Left)
{
Rectangle rectangle = new Rectangle(e.X - (LineWidth / 2),
e.Y - (LineWidth / 2),
LineWidth,
LineWidth);
rectangles.Add(rectangle);
Invalidate(rectangle);
}
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
if (rectangles.Count > 0)
using (Brush brush = new SolidBrush(LineColor))
{
foreach (Rectangle rectangle in rectangles)
pe.Graphics.FillEllipse(brush, rectangle);
}
}
}
|
|
|
|
|
I've never come across Curor.HotSpot[^] before! It's a good one to have. It's not totally clear, but I assume it's the offset from the the top left ( 0, 0 or Point.Empty ) of the control's active cursor rectangle. Using this offset, combined with your line width and mouse position, will give you an accurate drawing point for whatever wierd cursor the user or you may have selected!
|
|
|
|
|
hi, I'am using one mainform and a custom control on it. The custom control consists of some textboxes and a custom progressbar with text.
The mainform properties(for your reference) are: FormBorderStyle=FixedSingle, MinimizeBox=False, MaximizeBox=False
The question is: when I click on other programs(when my mainform is not the active window) and reclick on my mainform, especially the custom progressbar doesn't update its text on it even though the value is updated. All other controls(numericupdown and textboxes) updates properly.
Thanks in advance
|
|
|
|
|
Is your custom control's OnPaint method getting called? If so, try calling CustomProgressBar.Invalidate(); in it.
|
|
|
|
|
yes it is. It works smoothly in general.It only doesn't update its text after making another program's window active and return back to my program again.
Also I already tried Update(), Invalidate() and Refresh() methods of both the mainform, custom control and the custom progress bar separately.
May the reason be the custom progressbar itself?
|
|
|
|
|
It could be. Is your custom progress bar's drawing taking place in an overridden OnPaint? If not, then that's the problem.
|
|
|
|