|
I did this using a datagrid but the same result will apply.
Make an inherited user control that inherits the panel and simply set the width of the vertical scrollbar to 0 (and the height of the horizontal scrollbar).
This should give you the hidden scrollbar effect that you want.
|
|
|
|
|
.......
"WHERE studenti.user_name= '"+user+"' AND note.data < '"+date+"'";
the error comes from comparing the note.data which is also a date in a table built in MS Access,
this is the definition for date : DateTime date = DateTime.Now;
i must convert date.To"Something" or something like that but i dont know to what to dont get this error
is posible or must i do it somehow else?
Thanks
-- modified at 12:44 Sunday 4th June, 2006
|
|
|
|
|
Consider using parameterized queries. This would avoid type conversion errors like this, and is better practice since it avoids vulerability to SQL Injection Attacks.[^]
|
|
|
|
|
Access uses the # character around dates, not apostrophes.
Use parameterized queries, as Rob suggested, it will put the proper characters around the value regardless of what database you are using.
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone know how to change the location of a button using programming. I'm going to use it to make "simple" and "advanced" options in my search program.
Thanks
Hengy
I like Pie
|
|
|
|
|
Please don't double post, your old thread is perfectly suited for this question.
Anyway, here is the solution:
Button b = new Button();
b.Location = new Point(10, 10);
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sorry for the double post...
I have another problem:
when the doesn'tpick anything from a combobox, it says:
System.NullReferenceException was unhandled
but in my code, I put a default setting in my switch.
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked != true)
{
MessageBox.Show("Search");
}
else
{
switch (comboBox1.SelectedItem.ToString())
{
case ("Mininova"):
string targetURL = @"http://www.mininova.org";
System.Diagnostics.Process.Start(targetURL);
break;
case ("TorrentSpy"):
string targetURL2 = @"http://www.torrentspy.com";
System.Diagnostics.Process.Start(targetURL2);
break;
case ("IsoHunt"):
string targetURL3 = @"http://www.isohunt.com";
System.Diagnostics.Process.Start(targetURL3);
break;
case ("MyBitTorrent"):
string targetURL4 = @"http://www.mybittorrent.com";
System.Diagnostics.Process.Start(targetURL4);
break;
default:
MessageBox.Show("Please select a website to search.");
break;
}
}
}
any ideas?
thanks for the help... I seem to be asking alot of it today!
Hengy
I like Pie
|
|
|
|
|
If no selection is made, then the target of the switch() statement is null - comboBox1.SelectedItem is uninitialized, so you can't call the ToString() method on it.
change the if -else statement to:
if (checkBox1.Checked != true)
{
...
}
else if (checkBox1.SelectedItem != null)
{
switch (comboBox1.SelectedItem.ToString())
{
....
}
}
else
{
MessageBox.Show("Please select a website to search.");
}
Last modified: Sunday, June 04, 2006 6:20:40 PM --
|
|
|
|
|
I am developing a serch application. I want to it to have a "Simple" option and an "Advanced" option. When I press the Simple button I want some options to disapear (which I can do) and the form to get smaller (reduce Height only).
I need help with code for making the form smaller. I have tried using the MSDN site examples, but Visual Studio 2005 doesn't recognize:
Form1.Height = 145
It says I need aditional information (System.Windows. etc.)
Hengy
I like Pie
-- modified at 10:18 Sunday 4th June, 2006
Hengy
I like Pie
|
|
|
|
|
What's the exact error message? This works fine:
this.Height -= 150;
this.Width += 200;
this.Height = 300;
If you want to change these values from outside the form, then you need to replace this with an instance variable of your form, like this:
Form1 form = new Form1();
form1.Height = 200;
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks
The second piece of code didn't work, but I played around with it and finally did get it to work.
this.Height = 145;
Hengy
I like Pie
|
|
|
|
|
You can't directly access the Form1 class and call Height as a static method.
You need an instance of your Form1 object, which you already have, namely form
Form1 form = new Form1();
form.Height = 200;
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I'm a little lost in what you said... I'm kind of new to C#, but thanks anyways.
Hengy
I like Pie
|
|
|
|
|
Whenever you need to resize your form, you can reset the size property of your form like
this.size=new Size(newWidth,newHeight)
As soon as this line will be executed, you form will be resized. Here you can give the height and width whichever you want. But remember, you need to take into consideration the new sizes of your controls on the form since they may not look pretty with the resized form. That's it...
Wasif Ehsan.
|
|
|
|
|
Hi
I'm trying to have my text bounded by a circle, so that it follows its edges. How can I do this?
cheers
|
|
|
|
|
There are articles on the Internet (I remember seeing at least one on this site) about that, with code.
The case of a circle is relatively easy, mostly a task in converting polar to Cartesian geometry. Break your text into letters and determine the angle for each letter based on the tangent at that point.
The hard part isn't making your text fit on a circle, but the leading between letters. If you're using a variable pitch font, how good the text looks is largely about pair kerning between letters. It's about combinations like "oo" and "oi" not having the same spacing. TrueType contains some hinting, so maybe there's some way to tap into that and pull out instructions from there.
|
|
|
|
|
GraphicsPath will do that for you
|
|
|
|
|
Thank you!!
Also how could I have a text "fill" of a circle, instead of the rectangle? Can this be done with graphics path?
cheers
|
|
|
|
|
just that ...¿?
BiGjOe
Passez Ce Qu'il Passe
|
|
|
|
|
Wiki, as usual.
This technique can be applied to all programming languages. Do you have any C# specific question?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hellow to all
i am new to C# i tried to make a Model like in VB.NET where i can put variable there and all the forums can read them , or write a public function but i couldn't , what method in C# replace what i am trying to do ?
where can i find good articls to study moveing from VB.NET to C# ?
thank to all for anyhelp ...
|
|
|
|
|
hi there is no (modul) in c# !! try to implement public static (shared in vb.net) the following likns will help you
1 http://www.kamalpatel.net/ConvertCSharp2VB.aspx
2 http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx
Tamimi - Code
|
|
|
|
|
The on-line converters mentioned in the other post have serious shortcomings such as not handling generics, see the following for a full list http://www.tangiblesoftwaresolutions.com/Articles/Language%20Features%20not%20Handled%20by%20On-Line%20Converters.htm[^]
The demo of our Instant C# converter will be more useful as it actually converts VB.NET code (2005 or not).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter and VB to C++ converter
Instant J#: VB to J# converter
Clear VB: Cleans up VB.NET code
Clear C#: Cleans up C# code
|
|
|
|
|
I would like my treeview to remember if the user had a node expanded or not
previous to a refresh. I have found the method expand(), which I think will
do this, but I'am having problems implementing it.
The code compiles but I get runtime exceptions when I launch the application.
Bottom line question,
How do you properly implement treeview.expand()?
Cheers,
-t-
-- modified at 10:51 Sunday 4th June, 2006
|
|
|
|
|
if you want to add from serverXml to PcXml according to your conditions :-
private void AddRow()
{
DataSet serverXml = new DataSet();
serverXml.ReadXml("ServerXml.xml");
DataSet pcXml = new DataSet();
pcXml.ReadXml("PcXml.xml");
foreach(DataRow newRow in serverXml.Tables[0].Rows)
{
string ID = newRow["ID"].ToString();
DataRow [] TempPcRows = pcXml.Tables[0].Select("id= " + ID);
if(TempPcRows.Length != 0)
{
TempPcRows[0].ItemArray =
}
else
{
pcXml.Tables[0].ImportRow(newRow);
}
}
pcXml.WriteXml("PCXml.xml");
Tamimi - Code
|
|
|
|