|
I have been using Anakrino to have a look around inside the System.Windows.Forms.DataColumnTextBoxColumn class and there is something I do not understand about the decompiles.
I quite often see the line goto i-1; but there is never a matching label to go with it (the Edit method being an example). Also Visual Studio will not compile a goto statement in that form, it chokes on the -1 part.
Can anyone give me a hint as to where it is going to jump to with a lable of i-1?
Thanks
Stephen.
|
|
|
|
|
I've seen that with anakrino as well. The best way I've found to figure out what's going on is to open up the ILDisassembler tool in the sdk and try to find that line. Of course, you'll have to know how to fumble your way thru IL a bit to do this.
|
|
|
|
|
I find this normally happens when there is a mixture of managed and unmanaged code compiled into 1 assembly. I could be wrong.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I am writing an ASP.NET application where I have an invisible button. What I want to do is to programmatically raise the button's "OnClick" event so that a client-side function that is attached to the button will be called. Is there a way to manually raise the event? Trying to call "OnClick" directly does not work as the compiler gives an error. I know that VB.NET has a RaiseEvent keyword, but no apparently no such counterpart exists in C#. So, is there a way to manually raise events in ASP.NET controls?
"What would this country be without this great land of ours?" -Ronald Reagan
|
|
|
|
|
are you saying that you want to call the clientside jscript eventhandler for a button, from the serverside, when the button isn't even being rendered to html because it is set to Visble = false?
|
|
|
|
|
newbie here so please be kind
why won't this work?
SqlString = "SELECT * FROM Accounts ";
SqlString += "WHERE (Nick IS"; // or with the "=" sign
SqlString += tNick;
SqlString += ")";
recset.Open(CRecordset::forwardOnly,SqlString,CRecordset::readOnly);
i am trying to find the "id" so i may search another record
shotgun
|
|
|
|
|
It appears you're using MFC instead of C#, but you are missing a space between 'IS' and the tNick parameter.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Hey all - I've been trying to get this to work all morning. I have a .cs file that looks like the following:
<br />
using System;<br />
[assembly: AssemblyKeyFile(@".\MyPair.snk")]<br />
namespace Seruyange.David.Examples{<br />
public class StrongName{<br />
public void test(){<br />
Console.WriteLine("This is a test...");<br />
}<br />
public static void Main(){<br />
Console.WriteLine("Here is main");<br />
}<br />
}<br />
}<br />
I generated the .snk file okay. I try compiling with the following:
<monospace>
csc /out:test.exe TestAssembly.cs
But I always get the error:
Type or namespace name 'AssemblyKeyFile' could not be found (are you missing a using directive or assembly reference)
Can anyone help? I'm just trying to generate a strong name.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
|
Thanks Nnamdi - good eye.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Hi,
I would like to create a drag box on a form. The behavior that I'm talking about is what you see in the Form Designer of the IDE when you click and hold down the mouse button on a form (but not on a control that you placed) and drag the mouse. A dashed box is drawn while you hold down mouse. Could somebody tell me where I should be looking to begin coding something like this? (It would be cool if there were an example but anything would do.)
Thanks!
|
|
|
|
|
I have a database that contains 2 tables.
The first called Users contains username and password
the second called PhoneNumbers contains a primary key called PhoneNumberID, a User column and a column with the telephone numbers of the users, that can be 0, 1 or more.
There is a relationship one-two-many between the username in the Users table and the username in the PhoneNumbers table.
Now I want to make an application that displays the phone numbers of a given user and allows to add or delete new numbers.
I thought that the best method is to use a listBox, a texBox and two buttons, add and remove.
The user loads the data from the database, populate the listBox, selectt a number and clicks delete, and the number is deleted. Write a number in the textBox and clicks add and the number is added.
I make this through an XML Web Service.
I have a method that takes username and password, and returns a DataSet to the clien.
Than i use foreach to add all the returned phone numbers to the listbox.
Now THE QUESTION:
How I manage the update?
If a user added a phone number, the update should add a row to the database, if delete delete the corresponding row.
When the user clicks the update button, the code should,
check all the items actually in the listbox, determine if it was added, or know if some of the previously held was deleted.
HOW I ACCOMPLISH THIS?
And after this, how I create a link with the rows in the database, since the listbox, contains only the phone number value, but no primary key of the PhoneNumbers table?
An help is greatly apreciated.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
hmmm - may take a while for me to pick the code out.
Are you trying to write your own based on the one by Carlos H. Perez? or just use that one in your project? If the latter, it is rather easy to use.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
im making my own one,
Good luck then! how's yours different? it is suitable for general-case use? if so, you could write an article for CP
Cheers,
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
In my main form's code, it has a button for adding another tabbed pane with
the following handling code:
<br />
private void button2_Click(object sender, System.EventArgs e)<br />
<br />
{<br />
<br />
BidPage bp = new BidPage(tabControl1);<br />
<br />
bp.Location = new System.Drawing.Point(4, 22);<br />
<br />
bp.Size = new System.Drawing.Size(552, 326);<br />
<br />
bp.TabIndex = this.tabControl1.TabCount + 1;<br />
<br />
bp.Text = "BidPage" + currID;<br />
<br />
tabControl1.TabPages.Add(bp);<br />
<br />
<br />
<br />
currID++;<br />
<br />
}<br />
<br />
However, when a new BidPage is added, it's supposed to contain a button, but
it's blank! What's going on? Here's the BidPage class code:
<br />
<br />
using System;<br />
<br />
using System.Windows.Forms;<br />
<br />
namespace WindowsApplication1<br />
<br />
{<br />
<br />
<br />
<br />
<br />
public class BidPage : TabPage<br />
<br />
{<br />
<br />
private Button removeButton;<br />
<br />
private System.Windows.Forms.Label label1;<br />
<br />
private System.Windows.Forms.Button remButton;<br />
<br />
private TabControl parentTabControl;<br />
<br />
public BidPage(TabControl tcOwner): base()
<br />
{<br />
<br />
<br />
<br />
<br />
InitializeComponent();<br />
<br />
parentTabControl = tcOwner;<br />
<br />
}<br />
<br />
private void InitializeComponent()<br />
<br />
{<br />
<br />
this.SuspendLayout();<br />
<br />
this.label1 = new System.Windows.Forms.Label();<br />
<br />
this.remButton = new System.Windows.Forms.Button();<br />
<br />
<br />
<br />
<br />
this.label1.Location = new System.Drawing.Point(17, 17);<br />
<br />
this.label1.Name = "label1";<br />
<br />
this.label1.TabIndex = 0;<br />
<br />
this.label1.Text = "label1";<br />
<br />
this.label1.Click += new System.EventHandler(this.label1_Click);<br />
<br />
<br />
<br />
<br />
this.remButton.Location = new System.Drawing.Point(98, 17);<br />
<br />
this.remButton.Name = "remButton";<br />
<br />
this.remButton.TabIndex = 0;<br />
<br />
this.remButton.Text = "remove tab";<br />
<br />
this.remButton.Click += new System.EventHandler(this.remButton_Click);<br />
<br />
<br />
this.ResumeLayout(false);<br />
<br />
}<br />
<br />
private void remButton_Click(object sender, System.EventArgs e)<br />
<br />
{<br />
<br />
parentTabControl.TabPages.Remove(parentTabControl.SelectedTab);<br />
<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
|
|
|
|
|
After you 'new' the button, you must then add a call to this.Controls.Add(remButton) . This tells the TabPage that it is the "Owner" of the button and should then display it, if remButton.Visible = true. You can do this either in the Initialize() or in the constructor.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
How can I stop a form from redrawing itself while I make a lot of changes to its child controls?? In Win32 there is the WM_SETREDRAW (or is it WM_REDRAW) message. Is there a way to do it in Windows Forms? Or do I have to send the message to the Windows the Win32-way? if so, how do I do that?
Thanks,
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
You can use this method:
Control.SuspendLayout Method
(from help)
"The layout logic of the control is suspended until the ResumeLayout method is called.
The SuspendLayout and ResumeLayout methods are used in tandem to suppress multiple Layout events while you adjust multiple attributes of the control. For example, you would typically call the SuspendLayout method, then set the Size, Location, Anchor, or Dock properties of the control, and then call the ResumeLayout method to allow the changes to take effect."
Hope this helps.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Hi, try adding these 2 lines to the constructor of the form/control:
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
From the MagicLibrary help file:
The first line will request that double buffering be used whenever the OnBackground or OnPaint methods are called. This will reduce the amount of flicker but may not remove it completely as painting the whole control still results in two separate blitting operations.
The second line of code above is used to ensure that only a single blitting operation occurs when drawing. This occurs when the underlying windows WM_PAINT message is processed. When this happens it will create the memory bitmap, call the OnBackground method, call the OnPaint method and then finally blit the result to the screen.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
This doesn't stop the form from painting itself while everything is being moved. It does stop most of the flickering involved but with him moving/resizing controls more will have to be done to prevent the redrawing.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|