|
Hi All
I am using the followinf statment in my app at work
DataRow[] adr = dlg.PMIClient.DataSet.Tables[0].Select("ServerID=" + nServerID.ToString());
the ServerID has long datatype.
this statement works well for the int id values, but if nServerID has a long value and if the value in the dataset the result of select will be nothing even there is a record that has the same id in the dataset
in other words the Select works well if ServerID is int not long.
|
|
|
|
|
In the DataSet definition itself, have you set the ServerID field to int or integer?
If I remember correctly, it must be integer to account for a long value, but whatever it is, try the other one.
Paul
And you run and you run to catch up with the sun, but it's sinking Racing around to come up behind you again The sun is the same in a relative way, but you're older Shorter of breath, one day closer to death - Pink Floyd, Time
|
|
|
|
|
I have a form with a background image. In the form is a user control. I have set the style of the user control to support transparent background. I have also set the color to be transparent. When the user control is drawn in the form, it sometimes show the image in the background fine,but other times, the image in the background is not lined up with the edges of the panel. It looks like the user control is holding on to a different rendition of the form background image that is slightly off centered.
Is there a way to make the image that is showing through the user control be exactly what is in the form background image? I am guessing I have to override the paint method, but the form should not be painting anything in the background, right?
Doesn't the child user control get invalidated when the parent form gets invalidated?
thanks
Bryan
|
|
|
|
|
Hello every one!
I found this article on how to creat a custom IE toolbar (like the one Google has):
http://www.codeproject.com/useritems/toolband.asp
Problem is, that this article is in C++.
Does anyone out there know of an example using C#??
I'd like to write a custom IE toolbar, where the user can download it and install, etc.
Also... the option of uninstalling.
Any help on this will be greatly appreciated!
Thanks in advance!
|
|
|
|
|
C#iruzo wrote:
Does anyone out there know of an example using C#??
There is one called BandObjects(here on CP) that is written in C#
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
C#iruzo wrote:
there might be one out there for Internet Explorer...
Its the same thing It works for both. I must warn you that its not very stable. EG, firing a thread do some work and closing the toolbar will cause windows shutdown dialog to be shown...
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I still haven't seen that behavior, and I'm doing somewhat complex stuff with my vertical Explorer Bar (which is slightly different from an IE toolbar, aka command bar). I'm even using XP.
However, you may find that the Command Prompt Explorer Bar at http://www.codeproject.com/csharp/CommandBar.asp[^] to be extra helpful, as it is an implementation that uses the BandObject library in a somewhat complex way. I think the BandObject library had been revised in the Command Prompt Explorer Bar project, and those changes may not have been updated on the BandObject page.
|
|
|
|
|
Hi, all:
I have WinForm app to edit MS Access DB. On the dataset I have serveral Master-detail tables( the Relation is edited in the schema editorat design time, not runtime). The Master table is databind to a datagrid and detail tables are databind to either datagrids or a set of textbox controls. When I first load ( fill) the data, everything works fine and textboxes display the correct data. When I change selections in the master table, the textboxes change accordingly. Now, when I REOPEN the MDB file, the the tables which databind to the datagrid works as before, but the table that bind to a set of Textboxes do not have any data displayed. I can NOT figure it out what is wrong. I appreciate any help/insight you have. Thanks very much. The following is the code I used to bind the data after I open and fill the dataset: dsMain1
***************
textBox1.DataBindings.Clear();
textBox1.DataBindings.Add(new Binding("Text", dsMain1, "MyMaster.MasterToDetail.name"));
textBox2.DataBindings.Clear();
textBox2.DataBindings.Add(new Binding("Text", dsMain1, "MyMaster.MasterToDetail.Title"));
textBox3.DataBindings.Clear();
textBox3.DataBindings.Add(new Binding("Text", dsMain1, "MyMaster.MasterToDetail.Company"));
***************
Dion
|
|
|
|
|
hello everyone, i'm a new member here ,i'm a student at my last year in computer science facuty & i really need for my graduation project to know if it is possible to send images to clients from a srver in client/server application done using sockets in C#....plz i need all the help i can get..
thank u all...
|
|
|
|
|
Impossible. What you ask is crazy.
Check out System.Net.Sockets
http://samples.gotdotnet.com/quickstart/howto[^]
Look under Networking / TCP Client & Listener.
Quote from a clever bloke :
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
|
|
|
|
|
ok ...do u have any other alternative.....plz tell me about it ....plz don't shock me like u did in the first msg...
|
|
|
|
|
Hi
I want to hide my WinForm window (and show a notifyicon).
I know how to do it with the hide and show functions now but at
first i used WindowState = Minimized and ShowInTaskbar = false.
When i then try to show my window again i cant get it to be normal,
minimized and maximized works but not normal?!?
For example if i run this code i cant get my window back...
private void button1_Click(object sender, System.EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
}
TIA Mauritsius
|
|
|
|
|
add this.Visible = True between this.ShowInTaskbar = true; and this.WindowState = FormWindowState.Normal; .
|
|
|
|
|
no, this didn't work .SRod. !!
Why ???
FormWindowState.Normal restores the previous statenot size and when the form is minimized the size is zero
this.ShowInTaskbar=false;<br />
this.Hide();<br />
this.Show();<br />
this.ShowInTaskbar=true;
|
|
|
|
|
when the ShowInTaskbar property value is changed, the underlying control is destroyed and recreated, hence the zero size. To get the right size, I believe you should call this.Handle (in fact, the implementation for this.Handle ensures the underlying control is created before it passes the handle back).
public void Forms.set_ShowInTaskbar(bool value) {
if (this.IsRestrictedWindow)
return;
if (this.ShowInTaskbar != value) {
if (value)
this.formState.set_Item(Form.FormStateTaskBar, 1);
else
this.formState.set_Item(Form.FormStateTaskBar, 0);
if (this.IsHandleCreated)
this.RecreateHandle();
}
}
|
|
|
|
|
Thanks for all the answers...
|
|
|
|
|
May I ask if it is possible to implement syntax highlight function using c#?
Example will be a great help.
|
|
|
|
|
I asked about this a little while back and there seems to be very little information available on it
I was pointed to sharp develop, an open source IDE for c# written in c#, to me this was of little use and far to complicated for what i need but it might be of use to you?
|
|
|
|
|
you could take a look at our syntax highlighter
http://www.compona.com/Default.ascx
(costs 155$ tho)
//Roger
|
|
|
|
|
So, may I ask, after I download the source of SharpDevelop, which component I should look for??
Thank you very much.
|
|
|
|
|
the first thing to do is compile sharp develop, once youve done that run it and open the sharpdevelop combine, it will list some components in the project browser, i cant remember which part its in, but its fairly obvious its one of the editor projects (either text editor or default editor).
I suggest you open a .cs file in the editor to see what it can do and see how complicated it all is! i pretty much gave up on it but if you do find anything of use (even a hint or two) or manage to develop a basic component i would be massivly greatful if you could share some of the mroe complicated areas with me
|
|
|
|
|
Hi all,
The simple test-case below shows a trivial WinForm with an exception in one of its event handlers.
Before the form is created and run, an exception handler is declared. Note that when the app. is run without the debugger (i.e. Ctrl+F5 as opposed to F5), the exception IS NOT CAUGHT...
Any body have any explanations / workarounds?
many thanks,
dm.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication7
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(290, 260);
this.Name = "Form1";
this.Text = "Form1";
this.VisibleChanged += new System.EventHandler(this.Form1_VisibleChanged);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch
{
MessageBox.Show("caught");
}
}
private void Form1_VisibleChanged(object sender, System.EventArgs e)
{
object i = null;
i.ToString();
}
}
}
|
|
|
|
|
Can you please explain what the problem is instead of just pasting some code?
Domster wrote:
object i = null;
i.ToString();
What are you trying to here? Are you trying to catch this? Then add a try/catch around this.
Domster wrote:
try
{
Application.Run(new Form1());
}
catch
{
MessageBox.Show("caught");
}
This will catch all exceptions (plus no info would be returned) and your application will exit. See previous reply , to see how to catch exceptions where they occur.
Cheers
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I am trying to create an owner-drawn TextBox control, but as anyone who may have tried this knows, overriding the OnPaint method is useless as the base class uses the Windows API for painting. I know I can capture the WM_NCPAINT message in WndProc, but the absolute most you can do with this in reality is paint a custom border for the TextBox, anything else just gets painted over by the base class.
So the question is, how can I paint the TextBox without having to resort to building the whole damn thing from scratch? Has anyone actually seen a custom painted TextBox actually implementsd in .Net? Or (hopefully) am I missing something here?
|
|
|
|