|
Like led mike said, read up from Microsoft on how to work with the PIA.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
I have a windows form that contains 2 buttons - a "Next" button and a "Prev" button.
When the form loads, a user control is loaded into the form. After the user presses the "Next" button, the user control is replaced by another user control. If the user presses the "Prev" button they move back to the prevous control. The process continues like this until 5 different user controls are loaded. i.e. I have implemented Wizard like functionaility.
This all works fine.
My problem is that the "Next" and "Prev" buttons are always enabled. I would only like the "Next" button to be enabled if the user has completed working on the User Control that they are currently on.
In other words, once a user has completed the minimum requirements of the control they are in, the "Next" button should become enabled.
An example of this would be a user control with a first name field. When the user fills in this field the "Next" button should be enabled.
Is it possible for the user control to bubble up this information back to its parent form, so that the button is enabled at the proper time?
Thanks,
Kabir
|
|
|
|
|
Hi Kabir
You can use a public bool variable (true/false) in your UC. When user fills a valid text, your flag goes true, else false. And your form can use your flag to complete your task.
While (true) { Human.isLearnable = true; }
|
|
|
|
|
if you are using delegates i don´t see how you didn´t achieve that after what you already coded?!
parent form? you meen main_form and only form right? because you load usercontrols in main_form? i don´t see where is the change
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
hello everybody
can somebody help me in formating excel cells inside a worksheet:
i tried
worksheet.get_Range(worksheet.Cells[2, 1], worksheet.Cells[2, 3]).HorizontalAlignment = HorizontalAlignment.Left;
but gave me an error i made a research i found that i have to use
... HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
the problem is that i couldn't find XlHAlign property i tried many reference but without any solution.
thank you in advance and kind regards
|
|
|
|
|
michael_jhons wrote: but gave me an error i made a research i found that i have to use
... HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
But it worked for me!
It's my code:
using System;
using System.Text;
using Microsoft.Office.Interop.Excel;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
WorksheetClass ws = new WorksheetClass();
ws.get_Range(ws.Cells[2, 1], ws.Cells[2, 3]).HorizontalAlignment = XlHAlign.xlHAlignCenter;
}
}
}
While (true) { Human.isLearnable = true; }
|
|
|
|
|
thank you pedram, it was the
using Microsoft.Office.Interop.Excel; i added as a reference but when i added from using XLHalign apears, thank you fro your help
|
|
|
|
|
Range rng = objSheet.getRange(col1, row1,col2 ,row2);
rng.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
enjoy it
soicodon : mihazu_undead@yahoo.com
|
|
|
|
|
Am I correct in thinking that the only difference is:
ref has to be preassigned but does not have to be used in the method
out must be assigned before returning but can be unassigned before calling the method
?
Are there any notable benifits of using either one?
[edit] Just discovered that if using out, the parameter is treated as if it is unassigned (even if it's already been assigned) as soon as you call the method. So it appears that ref is kind of an input and output parameter whereas out is just output.[/edit]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
modified on Friday, October 3, 2008 7:37 AM
|
|
|
|
|
|
Brij wrote: for 'ref' it doesn't need to assigned by callee
Yes it does.
Read the page that you linked to.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ref is input output on value types. For object types while it is technically the same you can accidentally change the pointer reference if you are not careful as objects are naturally passed by referenced. This was discussed on this very forum a few weeks ago.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: This was discussed on this very forum a few weeks ago.
Yes, and in many other places in times far far away. What was that old quip about monkeys, keyboards and the internet?
led mike
|
|
|
|
|
I don't know but if the punch line involve feces I don't want to hear it :p
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
led mike wrote: and in many other places in times far far away
I looked and read what I found, but was just seeking clarification as I wasn't 100%
led mike wrote: monkeys
What is it with the 'respected' members of this site and the desire to abuse anyone whenever they can? I won't take it personally, but it's not necessary or justified.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
DaveyM69 wrote: What is it with the 'respected' members of this site
Who says I am respected?
DaveyM69 wrote: to abuse anyone whenever they can?
I did not post my comment to you.
DaveyM69 wrote: but it's not necessary or justified.
Perhaps not in this case. In many others it is and without doubt. We see a large number of users here that make no attempt to learn software development. They seem to believe internet forums are a replacement for learning. Given the nature of text messages it is not always apparent when someone is not in that category of users.
If you are not one of those people, then you should not be offended by my comment, correct? In fact it seems you would be inclined to agree with it.
led mike
|
|
|
|
|
led mike wrote: it seems you would be inclined to agree with it
Most definately
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
It's refreshing to see an actual C# question here!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: This was discussed on this very forum a few weeks ago.
Sorry - I never saw it, I tend to be on here daily but somehow missed that one. Apologies.
Ennis Ray Lynch, Jr. wrote: you can accidentally change the pointer reference
Thanks - I'll investigate further as what I did find by googling never suggested that.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I think it was in the subtle bugs forum.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: For object types while it is technically the same you can accidentally change the pointer reference if you are not careful
Well, that's the purpose of using the ref keyword on a reference type.
Ennis Ray Lynch, Jr. wrote: as objects are naturally passed by referenced
No, they are not. You have to distinguish between passing a reference as argument and passing an argument by reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: No, they are not. You have to distinguish between passing a reference as argument and passing an argument by reference.
While you are technically correct most texts and online sources treat the value pass of a pointer to an object as a pass by value so what most people think is happening is a reference. Which is why I make the statements I did, most people do not know what actually happens behind the scenes and more often than not it creates strange bugs.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
I figured this was a bit of pointer magic creating the subtle(ish) differences. I'm searching right now to find some info on what pointers are passed where and what values/pointers are changed etc in the two different scenarios. Not found much yet though.
Thanks for your clarifications.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: While you are technically correct most texts and online sources treat the value pass of a pointer to an object as a pass by value so what most people think is happening is a reference.
I see that your intention was to spread knowledge of this, but as your statement is technically incorrect, it doesn't do much to help...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Objects are always addressed by reference as they are stored in the heap. The pointer to the object, which is hidden in C# is what is passed by value and reference. Both of our statements are technically correct as it depends on how you are looking at the problem. My statement does a lot of help because anyone that reads it at face value will say ... "Wow, I didn't know that I am going to do some more research".
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|