|
By default, when you add controls in the designer (which I assume you are using) they will be set at 'private'
So, if you want to have them available, go into the designer file and set them to 'public' but this is bad practice.
What exactly do you want to do with these controls and maybe I can give a better suggestion?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
In this instance, I need to take the value entered by the user and pass it as a variable to a API call.
The value may also be used in a lookup in a query on a database.
I hope that helps.
WHEELS
|
|
|
|
|
So you want to get the value of 1 textBox?
the property example i gave you will do this... you could also try a simple method...
public string GetMyValue()
{
return TextBox1.Text;
}
...thou that's basically a property without a 'setter' (a 'getter')
P.S make sure you use parameters in any database query you do using user defined values
Life goes very fast. Tomorrow, today is already yesterday.
modified on Wednesday, July 8, 2009 9:19 AM
|
|
|
|
|
Thank you musefan.
I appreciate your willingness to help and your prompt responses.
Have a great day, WHEELS
|
|
|
|
|
No problem
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
how can can i load an image from a file in to a picture box in mobile application (not using filedialog)
when the page loads it must display the picture
This code was posted by me...
|
|
|
|
|
Well you can use...
PictureBox1.Image = Image.FromFile("filepath");
But you will probably bump into file access issues at some point so use the following...
FileStream fs = new FileStream("filepath", FileMode.Open, FileAccess.Read);
PictureBox1.Image = Image.FromStream(fs);
fs.Close();
That should do the trick for you
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
both fromfile and fromstream are not available in mobile application
This code was posted by me...
|
|
|
|
|
well you didn't say anything about that in your original post. - Hmmmm... was that there before? My bad if it was
Are you using the compact .Net Framework? Here's[^] one of many links on a google search
P.S There is a forum dedicated to 'Mobile Development'
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
byte[] data = new byte[1024];
data=receivefile();
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
try
{
FileStream fs = new FileStream("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Create);
ms.WriteTo(fs);
ms.Flush();
fs.Close();
ms.Close();
i m getting "exception in this code"
pictureBox1.Image = new Bitmap("\\Program Files\\pic\\screen.Bmp");
}
i getting "Exception" int he last line
it is not telling what is the exception just Exception
This code was posted by me...
|
|
|
|
|
well first thing I see is that the two file paths are not the same, if that not the problem can you confirm that a Bitmap is successfully created opening it manually?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thats not a matter when debuggin i copy the image from
\\Program Files\\syswifi\\pic\\screen.Bmp
to
\\Program Files\\pic\\screen.Bmp
This code was posted by me...
|
|
|
|
|
you say you don't get an error message. is that because you are handling the catch yourself? either add a messages box showing the exceptions message. Or remove the try catch and let the system give you an error message. maybe that will help
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
the exception is caught in the line
picturebox.image=new bitmap(fs)
where fs is filestream
This code was posted by me...
|
|
|
|
|
NullReferenceException is caught in that line
This code was posted by me...
|
|
|
|
|
well if you add a break what object is null? The PictureBox? The Image? or the Bitmap?
Can you put in code to verify the file exists...
if(File.exists("filepath"))
//show message
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
i don knwo wht is happening,The file is created. that i can see when when i browse the folder. but null reference exception is shown when i run applcn.
here is the code
FileStream fs = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp",FileMode.Create);
ms.WriteTo(fs);
ms.Flush();
fs.Close();
ms.Close();
FileStream fstr = File.Open("\\Program Files\\syswifi\\pic\\screen.Bmp", FileMode.Open);
pictureBox1.Image = new Bitmap(fstr);
This code was posted by me...
|
|
|
|
|
What is it that is null thou?
OK what i suggest is you put a breakpoint after each line of code and check the status of each variable (also check the new bitmap once the first filestream has been closed)
you can also use a message box in each line and the pause the application for each one if you prefer.
Hopefully then you can confirm what value it is that is null and get somewhere from there
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
it worked...thanx
This code was posted by me...
|
|
|
|
|
Hello Experts!!
I am creating treeview at runtime also added node to treeview successfully but i dont know how to add child node to respective same node.
Help!!
|
|
|
|
|
|
I would assume you added the first node with...
TreeView1.Nodes.Add("a node");
Well, each node also has a collection of nodes so if you store the return value of the above method, or obtain the node with another method search as find then you can add nodes to the collection like...
TreeNode baseNode = TreeView1.Nodes.Add("Something");
baseNode.Nodes.Add("My First Child Node");
Hope that helps
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
hi
String domainAndUsername = domain + @"\" + username;
the above line is creating an exception looks pretty ok to me
domain and username are passed through the arguments in this function they are returning it well though
is concatenation a problem if done through this way
|
|
|
|
|
rhcp08 wrote: the above line is creating an exception looks pretty ok to me
English laguage has something called comma and full stop. It makes life easy to understand.
In between, what exception message are you getting? Would you explain in detail?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
What exception are you getting? Do you have a null string by any chance?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|