|
Well, all you need to do, is track what was recently used, and add to your container, right ?
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.
|
|
|
|
|
I need to figure out how to create the button dynamically, which I have. But creating a click event for the buttons dynamically is giving me trouble.
|
|
|
|
|
here's my current code to add a button:
public void updateMRU()
{
ButtonItem button = new ButtonItem(filename,"&1 " + filename);
button.ImagePaddingHorizontal = 8;
button.Tag = filename;
menuFileMRU.SubItems.Add(button);
}
The last line to assign an event handler gives me an error before compilation.
The name button_Click does not exist in the current context.
Every example I've found to create a button and event handler looks like this. If I remark that line out my button does appear in the correct spot with all the information. Why can't I get the EventHandler to work?
By the way I'm using DotNetBar and placing the control inside a GalleryContainer, but it allows for buttons and according to Dev Components their Buttonitem is just an overloaded Button control.
|
|
|
|
|
Hey guys,
I am a begineer programmer and would like to learn C# for Network or Socket programming. I would like to know if there are any PDF versions of a tutorial that i can download.
Todd.
|
|
|
|
|
Hi,
this[^] might help.
Personally I recommend buying and studying a book on the subject.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Look for "Quick Start" in vss startup menu in your PC.
Fully version of VS.Stdio include about it.
|
|
|
|
|
This is more of an Access question, but I don't see a forum here for Access...
One of my clients has asked me to upsize an Access application to C#/SQL. I can't figure out how
to open the forms or database in design mode. Most of the the menu & toolbars are hidden. I'm sure
it's some kind of security thing, but I don't know Access well enough.
The only file they gave me was an .MDB file. Is there more? Anyone wanna shed some light here?
Thanks alot.
Everything makes sense in someone's mind
|
|
|
|
|
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));
}
}
|
|
|
|