|
The article at this link will help you move the Windows Form Designer generated code to a separate .Designer.vb file for each form in your project.
I don't think, however, that will solve your problem with initializing me.name . My programs all have code to initialize me.name without an error.
I experimented and found that if my code contained a CONST declaration similar to the following declaration, I get the same error as you do.
CONST name as string="Cause an error"
Because of this, I think you have a variable, Sub or Function (maybe a CONST ) in your code that is called "name". If so, change it to something else like "thename" and see what happens.
|
|
|
|
|
Parent = context.table
child = From t in parent where ...
In properties, the datasource is set to parent as well.
The bindingnavigators.bindingsource are set to child, all controls and datagrids are bound to the child bindingsoure.
Add new will instaniate a new row. It displays in the datagrids; however, it will not save. The primary key field maintains 0. As soon as I sort or call a new query the row is gone. On reload the row is gone.
Is there a problem with a child binding source?
me.validate()
me.parentsource.endedit()
me.child.endedit()
parent.resetcurrentitem()
me.context.submitchanges()
I have tried ending edit in reverse order and not reseting the current item (needed to update the changes, which works correctly for some strange crazy reason). The problem exists solely with saving a new row.
Does it make a difference that there are two binding navigators? Due to space and design, I opted for 2, but I have tried the addnew on the second.
Hmmm ... Ideas? (Asked in VB too. Saw the forms forum after.)
|
|
|
|
|
Actually, I solved this in quite an odd manner. I added a textbox for the primary key that was linked (bound) to the parent datasource. This solved the add new.
Why the child could not aquire a key value is beyond me. I simply hid the textbox by placing it behind another control. Oh, that reminds me. You cannot set the visibility to false and the key still add. Again, another thing that eludes me entirely. What does visibility have to do with it? I could not find any documentation that linked the visible status to the enabled status, but ah well. Problem was solved.
|
|
|
|
|
Hey all, is there a way to detect if ANY control is clicked inside a form? The MouseUp, -Down and so on events can only be set for the form itself, but as far as I have tested i out not for any controls that reside inside it - true? Is there another way? Cheers, Dennis
|
|
|
|
|
Please don't crosspost; pick a forum and stick with it. Most of us read multiple forums, and it scatters the answers over various threads.
Original thread is here[^].
|
|
|
|
|
I feel sorry for this poster. He was told to post here, and he's only done what he was told.
|
|
|
|
|
Yup, I spoke too soon again.
|
|
|
|
|
Dennis Bork wrote: The MouseUp, -Down and so on events can only be set for the form itself, but as far as I have tested i out not for any controls that reside inside it - true? Is there another way?
False, anything that inherits from Control[^]. See Richards'[^] answer for a recursive method that loops all controls, and hook 'em up to a single event-handler. The 'sender' argument would tell you what control was clicked.
|
|
|
|
|
Hello Dennis Bork,
With regards to your question,
http://stackoverflow.com/questions/986529/how-to-detect-if-the-mouse-is-inside-the-whole-form-and-child-controls-in-c
Hope this helps!
Best of Luck!
With Kind Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:33am.
|
|
|
|
|
try this logic...
On Form MouseClick Event
{
if typeof control (at current mouse pointer) not equal to panel, and groupbox and... Then
{
detected that non container contol is clicked
}
else
{
detected that container contol is clicked
}
|
|
|
|
|
Hi,
One other (slightly heavy handed) possibility is to override the Windows Procedure in your form.
You can then intercept all the windows messages it receives, and filter down to the mouse events.
eg:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
}
}
You can get an enum containing all the windows message constants here: [^]
|
|
|
|
|
Hi Friends,
I have an installer developed in Wix. I want to execute one batch command during the upgrade operation. I added one Wix custom action in wxs file. Anybody know to which sequce should i add this for my requirement.
Any help would be really blessing for me.
-Prasanth
|
|
|
|
|
Hello.
I want to add a new record into my database( example: StudetDatabase, if i want to add a new student to database then what do I doing? using data binding.
Thanks so much.
|
|
|
|
|
LearnByHeart wrote: if i want to add a new student to database then what do I doing?
You start a browser and go to MSDN[^]
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
AFAIK, databinding will still require at least a mechanism to update. It doesn't work like the old VB recordset.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi there,
How can I do a currency formatting for a text box in C#?
My requirement is - Text box should accept numbers only upto 2 decimal places and after focus is changed format should change like $3,454,54.89.
Thanks
|
|
|
|
|
Are you using databinding to get the value in there, or putting in the value manually? With databinding, it'd be using the FormatString[^] property of the binding;
textBox1.DataBindings.Add(new Binding(
"Text",
Properties.Settings.Default,
"ConnectionString",
true));
textBox1.Databinding[0].FormatString = "C";
Alternatively, you could keep the value in a private variable, set it when the user is done editing, and update with a formatted version when the focus is lost. A description of the markup can be found here[^].
If the subject is "new", MSDN has an introduction here[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
modified 24-Oct-12 17:05pm.
|
|
|
|
|
Hi Every Body
I have A Problem & Hope You can Help ME.
I know How I can Change Form Oopacity But I don't KNow How i can change Control Opacity ??
For Example How i can change a button Opacity IN C#.net Windows Application
Thanx Of All Developers.
|
|
|
|
|
Please pick the most appropriate forum. You have already asked this in another forum and received answers.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Coloca un PictureBox en un formulario y cambia con este codigo:
Dim x as integer = 255
PictureBox1.BackColor = color.FromArgb(x, Color.Black)
Cambia los valores de la variable x entre 0 y 255 para dar el efecto deseado.
Saludos
_______________________
Edward J. Ocando. | Desarrollador | SoyDesarrollador.net
Telefono. +58 (416) 164.34.88 | Edward.Ocando@soydesarrollador.net
|
|
|
|
|
Please use English.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Lo siento, solo hablo español, no uso ni me gusta el idioma ingles.
Soy de américa latina y apoyamos al 100% el uso del idioma español.
Te recomiendo usar Google translator..
!Que viva el idioma español.....¡
Saludos.
_______________________
Edward J. Ocando. | Desarrollador | SoyDesarrollador.net
Telefono. +58 (416) 164.34.88 | Edward.Ocando@soydesarrollador.net
|
|
|
|
|
Yes, but on CodeProject we use English. If that's a problem for you then I am sure there are many Spanish language forums where you will be welcome.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Es geht nicht nur um Amerika. Hier im Forum akzeptieren wir Englisch als den größten gemeinsamen Nenner.
For consistency's sake, we keep the forums English and use Google Translate for in- and output, if necessary.
Ciao,
luker
|
|
|
|