|
Item 1: No difference.
Item 2: Double Buffer? Not sure how to do that.
Item 3: No not every x seconds. I do re-populate after clicking on the button to obtain the hex dump from a memory chip.
Item 4: Could try for DataGridView.
|
|
|
|
|
Double Buffer can be found as Form property.
|
|
|
|
|
Why don't you use a DataGridView ? You have several predefined cell-types, textbox, combobox, checkbox,...
|
|
|
|
|
I have a custom control which produces a fairly intricate graph that takes some time to initally draw. The user uses the mouse to draw a selection rectangle on part of the image to be zoomed in on. This part of the code works fine, but the drawing is sluggish.
Right now, as the user clicks and drags, the graph is drawn and the rectangle is then drawn over that, so each time the user moves, the image must be redrawn. I know part of the paint message is the region that was invalidated, but its too complicated to redraw just a portion.
Is it possible to store the control image as a bitmap after drawing the first time, then whenever the mouse moves, replace the image with the bitmap stored in memory and draw my new selection rectangle? Is this a good approach, and if so, how do I get and set the control image? If this isn't a good approach, what is a better one?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Yes, just draw the graph to the bitmap in the first place, and draw that in your paint event.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
That was very simple to get working, changes for the reassurance
modified 12-Jul-20 21:01pm.
|
|
|
|
|
hi
i have a method that return DataTable (named GetData), now i want to load returned DataTable object to DataSet by this code :
this.ds.Load(dal.GetData(cmd1).CreateDataReader(), LoadOption.OverwriteChanges, new string[] { "transaction1" });
but before, load data, i want to clear some tables of my dataset objects by this code :
this.ds.Tables[0].Clear();
but at runTime the following error has shown me :
Cannot find table 0
how to solve my problem and how to clear before fill ?
thanks
|
|
|
|
|
hdv212,
if (this.ds.Tables.Count != 0)
{
this.ds.Tables[0].Clear();
}
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
First check your dataset have any table. If not no need to clear.
kesavan
|
|
|
|
|
Hello All,
I have this one asp.net 2.0 project that throws the following error when I attempt to use System.Diagnostics.Debug.WriteLine
{"Couldn't create listener 'textWriterTraceListener'."} System.Exception {System.Configuration.ConfigurationErrorsException}
It has an interesting inner exception of:
InnerException {"Illegal characters in path."} System.Exception {System.ArgumentException}
All of the other asp.net 2.0 apps I have run perfectly fine with that statement and previous versions of this application ran fine. Any ideas?
Thanks in advance,
Ryan
|
|
|
|
|
RB@Emphasys,
Show us some code.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I'm not sure exactly what you're looking for, it's simply erroring out when attempting to writeline, but here is the if statement:
if (CertificationPerson_RaceTable.GetRecords("IsActive = 1 And fkPerson = " + oCertPersonRecord.PK).Length == 0)
{
System.Diagnostics.Debug.WriteLine(oCertPersonRecord.PK + " " + oCertPersonRecord.fkRace);
oPersonRaceRecord = new CertificationPerson_RaceRecord();
oPersonRaceRecord.fkPerson = oCertPersonRecord.PK;
oPersonRaceRecord.fkRace = oCertPersonRecord.fkRace;
oPersonRaceRecord.Save();
}
Thanks,
Ryan
|
|
|
|
|
Check your application settings (web.config). Sounds like it's trying to trace to a file but someone made a typo in the file name or path.
As in:
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="InvalidFileNameHere.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
I bolded the place to look for the error.
Peter the small turnip
(1) It Has To Work. --RFC 1925[^]
|
|
|
|
|
Thanks Peter,
That did the trick. I spaced out on that one....
Ryan
|
|
|
|
|
Hi all!
I create a class that extends UserControl, and so, I try to add some mouse events to the objects that my app creates dynamically.
It follows the class UserControlEx, the one that I created.
public class ControlEx : System.Windows.Forms.UserControl {
private bool isDragging = false;
private int clickOffsetX, clickOffsetY;
KineticaRT.Controls.Dial lblDragger;
public ControlEx (System.Windows.Forms.TabPage tabPage) {
this.lblDragger = new KineticaRT.Controls.Dial();
this.lblDragger.Enabled = true;
tabPage.Controls.Add(this.lblDragger);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(controlEx_MouseUp);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(controlEx_MouseMove);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(controlEx_MouseDown);
}
private void controlEx_MouseDown (System.Object sender, System.Windows.Forms.MouseEventArgs e) {
isDragging = true;
clickOffsetX = e.X;
clickOffsetY = e.Y;
}
private void controlEx_MouseUp (System.Object sender, System.Windows.Forms.MouseEventArgs e) {
isDragging = false;
}
private void controlEx_MouseMove (System.Object sender, System.Windows.Forms.MouseEventArgs e) {
if (isDragging == true) {
this.Left = e.X + this.Left - clickOffsetX;
this.Top = e.Y + this.Top - clickOffsetY;
}
}
private void InitializeComponent() {
this.SuspendLayout();
this.Name = "ControlEx";
this.ResumeLayout(false);
}
}
As you can see, the constructor of the class, creates the object and adds the events to the control(lblDragger).
But, a problem occurs. When I press the mouse down and I try to drag the object nothing occurs. The mouse up functions also does not work.
private ControlEx dial;
private void button1_Click(object sender, EventArgs e) {
if (tcDataPanes.TabCount == 0) {
TabPageEx tabpage = new TabPageEx(tcDataPanes);
}
dial = new ControlEx(tcDataPanes.SelectedTab);
}
How can I solve this problem?
Thank you in advance.
Gustavo
|
|
|
|
|
Hi.
I need to display some information in the system tray using the notifyicon control, but the the notifyicon control only allows me to draw on a 16*16 space but I need around 16*64 space, How can I do this?
|
|
|
|
|
4 icons maybe? Not sure how well that will work :p
|
|
|
|
|
As leppie's suggested, some tools display multiple icons, but you've got no way of guaranteeing that they'll be displayed in a particular order.
Can't you just open a small 64x64 topmost window above the system tray and display your info in that?
|
|
|
|
|
Hi.
Thanks for replying.
I was thinkning of using 4 notifyicons, but I think that this will increase my headache.
I think that I have to go to the small windows solution.
|
|
|
|
|
Hi guys. I'd like to simulate keyboard keystrokes and not everything is working.
I'm using Postmessage and Sendmessage API.
Sending a character is simple using PostMessage(handle, WM_KEYDOWN, key, IntPtr.Zero), but I can't simulate key combos like shift+1 or capslock+a. For the combos here's what I tried:
PostMessage(handle, WM_SYSKEYDOWN, VK_CAPITAL, new IntPtr(1));
PostMessage(handle, WM_KEYDOWN, VK_A, IntPtr.Zero);
PostMessage(handle, WM_KEYUP, VK_A, new IntPtr(1));
PostMessage(handle, WM_SYSKEYUP, VK_CAPITAL, new IntPtr(1));
|
|
|
|
|
Did you look at the SendKeys API in the .NET framework?
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
SendKeys.Send is the first thing I tried, but it was limited: I can't send ctrl+shift among other things.
|
|
|
|
|
xax wrote: I can't send ctrl+shift among other things.
You're wrong, you can send CTRL+Shift using SendKeys[^].
Life, family, faith: Give me a visit.
From my latest post: "And you think, 'To keep my anti-Judaic theology alive I must reinterpret this verse too as being a blessing for Christians and not for Jews. I know it strains all manner of principles of interpretation. I don’t read the newspaper this sloppily, but, man, I have a theology to defend.'"
Judah Himango
|
|
|
|
|
At the top of your class:
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
Within your class you will need the following two methods:
private static void PressKey(byte keyCode)
{
keybd_event(keyCode, 0x45, 0, 0);
}
private static void ReleaseKey(byte keyCode)
{
keybd_event(keyCode, 0x45, 0x2, 0);
}
Simply send the correct keyCode to execute the press or release key method.
With these methods until the ReleaseKey method is called for a key it is held down by the PressKey method.
One word of warning - make sure you release all the pressed keys or wierd things will happen.
Regards
Guy
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
You'll give this a try. I've read that keybd_event is buggy.
Thanks.
|
|
|
|