|
You should be able to disable the AutoSize property of each button. At least you can in a ToolStrip . See this[^] screenshot for example.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thanks, but no luck there. The AutSize property is only for the Toolbar control only and not available for each button.
|
|
|
|
|
|
Hi,
I'm using WinXP SP2. Now, I want to use C# to control (turn on/off) the services (ex: Telnet, Telephony, Themes....) in WinXP!
Thanks much,
Hung.
Hung
|
|
|
|
|
|
Hello!
Doing some C# and trying to access my db.
Following a book from Wrox, they use VB - there is my problem.
How would I translate the following to C# ?
Dim PKvalue As String = FilterInput.Text; // Filterinput är en textbox
DIM Rowlocated AS DataRow = Me.MyDBDataSet.Person.Rows.Find(CType(PKvalue,Integer))
If Not ( RowLocated Is Nothing) Then
MessageBox.Show(CType(Rowlocated(1),String))
Else
MessageBox.Show(PKvalue & " record not located" )
End if
I tried out the Converter from VB to C# : http://www.developerfusion.co.uk/Utilities/convertvbtocsharp.aspx
But that did not help me, do not Quite understand the Rowlocated variable that is
an instance from DataRow.
Hopefully you are able to help me.
regards, i
"But if thought corrupts language, language can also corrupt thought." -George Orwell
|
|
|
|
|
string PKvalue = FilterInput.Text; // Filterinput är en textbox
DataRow Rowlocated = Me.MyDBDataSet.Person.Rows.Find(CType(PKvalue,Integer));
if (! RowLocated == null)
{
MessageBox.Show(CType(Rowlocated(1),String));
}
else{
MessageBox.Show(PKvalue + " record not located");
}
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
I don't think that is an accurate translation.
This might be better
string PKvalue = FilterInput.Text;
DataRow Rowlocated = this.MyDBDataSet.Person.Rows.Find(Int32.Parse(PKvalue));
if (! RowLocated == null)
{
MessageBox.Show((string)Rowlocated[1]);
}
else{
MessageBox.Show(PKvalue + " record not located");
}
Me == this
CType is a casting operator of some sort (more of a black box that C#'s casting operator as it can do string to int translations also)
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Instant C# produces:
string PKvalue = FilterInput.Text; // Filterinput är en textbox
DataRow Rowlocated = this.MyDBDataSet.Person.Rows.Find(System.Convert.ToInt32(PKvalue));
if (Rowlocated != null)
MessageBox.Show(System.Convert.ToString(Rowlocated[1]));
else
MessageBox.Show(PKvalue + " record not located");
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
|
|
|
|
|
Hi to you All!
Well the converter I tried gave this result:
string PKvalue = FilterInput.Text;
DataRow Rowlocated = this.MyDBDataSet.Person.Rows.Find(((int)(PKvalue)));
if (!((RowLocated == null))) {
MessageBox.Show(((string)(Rowlocated(1))));
} else {
MessageBox.Show(PKvalue + " record not located");
}
|
|
|
|
|
I have a figure in a winform, a rectangle, and a NumericUpDown, its miniumum and maximun values are 0 and 100, i want that when i increase the NumericUpDown value the rectangle must change its color, for example when the value is 0 the rectangle color must be black and when i increase the value the rectangle color must turning into white, when the value is 100 the rectangle color must be completely white.
I have seen some examples using LinearGradientBrush but i don't know exactly how to do that, somebody knows how could i do this?
Regards,
Alberto Martinez
|
|
|
|
|
If you want a solid colour which it looks like you do then you should use SolidBrush.
In the Change / Click event of the NumericUpDown invalidate the region where you're drawing the rectangle.
In the paint event handler do something like:
using (SolidBrush brush = new SolidBrush((byte)(numericUpDown.Value * (100 / 255))...
{
graphics.FillRectangle(...)
}
basically you need to scale 0-100 up to 0-255 for each red, green and blue component of the colour.
Regards Ed
|
|
|
|
|
Sorry to interrupt, but the code above will not work.
If your write (100 / 255) you'll get integer division resulting in 0, so the value of the numericUpDown won't have an effect for the color of the brush.
Besides, to get values between 0 and 255 you'll have to reverse the fraction.
So something like (int)(numericUpDown.Value*255/100) should work better.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I was thinking I needed more sleep and you just confirmed it
I got my fraction upside down
Ed
|
|
|
|
|
Hi,
Thanks both of you for your help i already could do what i needed
Regards,
Alberto Martinez
|
|
|
|
|
Hello,
Is it possible, while dragging a node in a treeview, instead of highlighting a drop node, but to display the insert line between the nodes (just like in your favourites menu in explorer) where the node will be inserted?
Please let me know.
Thank you.
|
|
|
|
|
|
hey guys, you know how we can bind DataGride to database by using SetDataBinding() and therefore any record i click on in my DataGride i will have it in my form to delete or
Update.
I haven't been able to do the same thing with DataGridView, it doesn't have such a command !!!
by the way in DataGrid is there any way I can change the header text for my colums, in DataGridView its possible but in DataGrid it ain't.
I'll be extremely happy if you can help me out.
|
|
|
|
|
The DataGridView uses the DataSource property to bind data, but before you start binding things willy-nilly, you should really have a look at the BindingSource object. This item is new in .NET 2.0 and takes much of the hassle out of complex data binding.
You should be able to change the header text for column i in the DataGrid with something like m_MyDataGrid.Columns[i].HeaderText = "blah"; .
--
I've killed again, haven't I?
|
|
|
|
|
I have already tried that, thats exactly what i use with DataGriedView, but there isn't such a thing in DadaGrid !!!
|
|
|
|
|
Yikes... yes, it seems the Columns are only available in the WebControlsDataGrid .
If the DataGrid is bound to a DataTable , you can use the Caption property of the DataColumn objects in the table to set the header text.
Or, you can create a DataGridColumnStyle with the desired HeaderText for each column, add them to the DataGridColumnStyles collection of a DataGridTableStyle , and add that to the DataGridTableStylesCollection of the DataGrid .
And THAT'S why I like DataGridView .
--
I've killed again, haven't I?
|
|
|
|
|
I've looked at some sample code and used the MSDN Library but its not really helping me. I'd like to be able to have code change the MaxLocksPerFile setting in the registry located Under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 4.0.
I can manually change this value but i would like to change it in the code. This needs to be increased because Microsoft Access has problems handling large amounts of data. I have an access database that has hundreds of thousands of records in it and when a user wants to update data in the database there is an error stating "File sharing lock count exceeded. Increase MaxLocksPerFile registry entry." Increasing the value significantly does fix the problem but it would be nice to change this value automatically with code when the user wants to update the database instead of having to go change the registry manually. Any help would be greatly appreciated.
|
|
|
|
|
Simple.
Use the Registry classes in the Microsoft.Win32 namespace.
Or you can refer to this[^]!
Hope this helps!
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
I have same problem. Can you help me?
acdb.ExecuteSQL($@"ALTER TABLE {tableName} ADD COLUMN ROW_NUMBER AUTOINCREMENT");
|
|
|
|
|
Hi,
I did not find answer to my question so why I here.
I try to write program that will load (bitmap,jpg-file, etc.) than I'd like to change this image (draw line, point, circle etc. on it) and than save it to disk. Has someone example of this issue?. I know how to load such image draw something on it but when I save it to disk I get file that is orginal image without changes. Moreover changes disapear when I minimize my image.
Thanks for help.
JM
|
|
|
|