|
I cant not.
Giva example if you cant.
thanks.
|
|
|
|
|
You saw that reply? He cannot read the docs. How possibly can you deal with an idiot of this order?! Morons like this are the reason why I asked Chris to appoint a moderator or two for each forum.
I've voted to remove his message. I'll remember never ever to attempt to help him.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
<sarcasm>
With respects sir, he clearly said "cant not", which is a double negative. That clearly means he can.
Some people...
</sarcasm>
|
|
|
|
|
Hey everyone,
I dont remember what I did but when building my solution I get this error:
The type name 'BUDGETLINESDataTable' does not exist in the type
'myNameSpace.ds_FINANCETableAdapters.ds_FINANCE'
C:\MyProjectPath\ds_FINANCE.Designer.cs
along with several similar errors all pointing to the dataset designer file.
Any hint/shared experience would be appreciated.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
modified on Sunday, June 21, 2009 5:08 AM
|
|
|
|
|
Check you namespaces.
Also your declaration (public/internal/private) can screw it up as well.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks Holmes, I just figured out that I accidently double clicked on the dataset and believe it or not, my whole problem was just because of the empty class created when the dataset was double clicked! I hate typed datasets!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
I have a form that is designed by GDI+, it has some buttons(images)
I want to change the button when the mouse is over the button
so I handled the MouseMove event with the OnMouseMove and I calculated if the mouse is in the button region , after that if it was, I call the method Invalidate() so that the button should be repainted but the problem is that the Program runs very slowly, and you can see the mouse movement in slow motion, when I comment the Invaliate() method in the code, everything is good, I also checked the code with an empty method of OnPaint() so that the problem is not because of OnPaint() but Invalidate()
by the way i am using the Double Buffred Form
I am confused
somebody help me
thank you
P.S:
here is the whole code:
From1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace paintImage
{
enum ButtonState
{
NotSelected,
Blue,
Green
}
public partial class Form1 : Form
{
ButtonState Language = ButtonState.NotSelected;
private bool MouseOutLanguageTraining = false;
private bool LanguageTraining = false;
private bool MouseOnLangugeTraining = false;
Rectangle LanguageButtonPosition = new Rectangle(774, 617, 218, 42);
readonly Image piccy;
readonly Image ButtonSelectedBlue;
readonly Image ButtonSelectedGreen;
readonly Image ButtonNotSelected;
private readonly Point[] piccyBounds;
private readonly Point[] LanguageButtonBounds;
public Form1()
{
InitializeComponent();
piccy = Image.FromFile(@"C:\pics\page12.png");
ButtonNotSelected = Image.FromFile(@"C:\Pics\Button Not Selected.png");
ButtonSelectedBlue = Image.FromFile(@"C:\pics\Button Selected Blue.png");
ButtonSelectedGreen = Image.FromFile(@"C:\pics\Button Selected Green.png");
AutoScrollMinSize = piccy.Size;
piccyBounds = new Point[3];
LanguageButtonBounds = new Point[3];
const int resolutionX = 1024;
const int resolutionY = 768;
piccyBounds[0] = new Point(0, 0);
piccyBounds[1] = new Point(resolutionX, 0);
piccyBounds[2] = new Point(0, resolutionY);
LanguageButtonBounds[0] = new Point(744, 617);
LanguageButtonBounds[1] = new Point(992, 617);
LanguageButtonBounds[2] = new Point(744, 659);
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics dc = e.Graphics;
base.OnPaint(e);
dc.DrawImage(piccy, piccyBounds);
if (LanguageTraining && (Language != ButtonState.Blue))
{
dc.DrawImage(ButtonSelectedBlue, LanguageButtonBounds);
LanguageTraining = false;
}
else if (MouseOnLangugeTraining && (Language != ButtonState.Green))
{
dc.DrawImage(ButtonSelectedGreen, LanguageButtonBounds);
MouseOnLangugeTraining = false;
}
else if (MouseOutLanguageTraining && (Language != ButtonState.NotSelected))
{
dc.DrawImage(ButtonNotSelected, LanguageButtonBounds);
MouseOutLanguageTraining = false;
}
}
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
if (e.KeyCode == Keys.Escape)
this.Close();
}
protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
Point mouseLocation = Control.MousePosition;
if (mouseLocation.X > 755 && mouseLocation.X < 992 && mouseLocation.Y > 625 && mouseLocation.Y < 659)
{
Invalidate();
LanguageTraining = true;
}
}
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
Point mouseLocation = Control.MousePosition;
if (mouseLocation.X > 755 && mouseLocation.X < 992 && mouseLocation.Y > 625 && mouseLocation.Y < 659)
{
MouseOnLangugeTraining = true;
Invalidate();
}
else if (mouseLocation.X < 755 || mouseLocation.X > 992 || mouseLocation.Y < 625 || mouseLocation.Y > 659)
{
MouseOutLanguageTraining = true;
Invalidate(LanguageButtonPosition);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
From1.designer.cs
using System.Drawing;
namespace paintImage
{
partial class Form1
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
piccy.Dispose();
ButtonSelectedBlue.Dispose();
ButtonNotSelected.Dispose();
ButtonSelectedGreen.Dispose();
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.SuspendLayout();
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.ClientSize = new System.Drawing.Size(1024, 768);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Form1";
this.TransparencyKey = System.Drawing.Color.Transparent;
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
}
}
|
|
|
|
|
This looks right to me. Of course, the mouse move is going to keep firing paint messages, it probably makes more sense to only fire the invalidate when the state changes.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
To add to what Chris said, it is probably that you are continually firing Paint messages - why not use MouseEnter and MouseLeave to handle the re-paint? That way, you don't recalculate on every mouse move, and you only fire the Paint when the image should be changing.
BTW: it is not good practice to use absolute numbers for mouse position checking - why not use the position of the button instead?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
Sorry this is gonna sound stupid I expect but here goes
Using
m_AutoCompleteStringCollection = new AutoCompleteStringCollection();
textBoxName.AutoCompleteMode = AutoCompleteMode.Suggest;
textBoxName.AutoCompleteSource = AutoCompleteSource.CustomSource;
textBoxName.AutoCompleteCustomSource = m_AutoCompleteStringCollection;
How, without a mouse, do you select an item for an autocomplete textbox? I have tried key down on the keyboard but that just makes a selection of the first item. I want the user to be able to select any item or type their one choice. This is going to be used as a login where the name can be a known name or a visitor.
Thanks,
Iain
|
|
|
|
|
Down arrow works fine for me. Set the focus to the item to be selected and press enter to select.
जय हिंद
|
|
|
|
|
Yes you are correct.
It appears that calling _TextChanged everytime resets the focus
E.G.
private void textBoxFirstName_TextChanged(object sender, EventArgs e)
{
if (textBoxName.Text.Length > 4)
{
getAutoCompleteSuggestions();
}
}
I have changed it to
if (textBoxName.Text.Length == 4)
To solve this
It does seem to crash a lot too in debug but I will save that for another day
|
|
|
|
|
Is there any specific need to display the autocomplete suggestions only after 4 characters?
जय हिंद
|
|
|
|
|
It was to keep the selection down to something reasonable. All works now thanks for your help.
|
|
|
|
|
I'm using the propertygrid control to display a small class (the class represents program settings) which contains a System.Drawing.Color, and some other properties.
When you click the dropdown next to the color and click a color... everything works fine.
The problem is if the user uses the Up and Down keyboard keys to change the color. When they do this the little color preview square next to the name of the color does not update until the Enter key is pressed.
I tried just using SendKeys to send Enter when the PropertyValueChanged event fires but unfortunately the control looses focus of the selected property.. which is exactly what happens when the enter key is pressed normally. But it's unnatural because your pressing the down and up keys to scroll through the colors... so ya Enter-key-sending is not the way to go.
Is their anyway to force that little color preview box to change to match the color name next to it
|
|
|
|
|
I sent the Tab key as well after enter and it worked fine for me. There might be a decent way to achieve this that I am not aware of.
This way:
SendKeys.SendWait("~");
SendKeys.SendWait("{TAB}");
जय हिंद
|
|
|
|
|
Excellent your code worked perfectly. Here's full code for anyone else that finds this thread.
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
SendKeys.Send("{ENTER}~{TAB}");
}
|
|
|
|
|
actually this will work to:
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
SendKeys.Send("{ENTER}{TAB}");
}
|
|
|
|
|
FocusedWolf wrote: SendKeys.Send("{ENTER}{TAB}");
This alone is enough. Actually "~" is just another way to send Enter key.
जय हिंद
|
|
|
|
|
|
Hi ,
I am usign propertygrid in my application . I am using one class i that i m having " Caption " prooperty. i am
I wrote this code to Keyboard UP left,right down keys to work . In that i am having the code to move the controls . according to below condition i am highlighting the property .
Private Sub PropGrid_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PropGrid.Enter
fGridEnter = True
End Sub
Private Sub PropGrid_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PropGrid.Leave
fGridEnter = False
End Sub
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean ' IN THIS i am having the code to move the control .
If (keyData = Keys.Down Or keyData = Keys.Up Or keyData = Keys.Left Or keyData = Keys.Right) And fGridEnter Then
PropGrid.SelectedGridItem.Select()
Return False
End If Now the problem is if i am entering caption for textbox then i use Keyboard up, down ,left ,right then Propertygrid is losing
the focus .
Textbox1.Caption = "ABC DEF " ' Here i amnot able to move the cursor using keyboard keys up, down ,left ,right
to change the text of the texbox . How to identify the things ??
|
|
|
|
|
Hello
I'd like to know a way to add a combobox on the header of a datagridview. Not in each column cell. But in the header, next to the column name. The cells of the grid should remain just as the column was a textboxcolumn.
Many thanks
|
|
|
|
|
Just build a custom user control.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Look at the example here [^]at MSDN.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I want to develop an application in C# to access a remote desktop and show it to another computer. Like I'm the server and there's two clients, one whose desktop i'm getting, and the other client will see it. I would like to know how to start to develop such an application. Please give me some useful links or documents or anything for initial starting.
|
|
|
|