|
BlitzPackage wrote: int iNumber = 0;
iNumber = myRandom.Next(1, 8);
This code needs to be in a method, you can't set a value outside of a method, except the way you did it first ( to 0 )
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks Christian, you're absolutely right!
|
|
|
|
|
Hello i am trying to override a listview's Items property i have created a new ListItems method that implements a custom UITypEeditor for ListViewItem allowing my to insert my own type that inherits from ListViewItem called ControlItem now sow far all of this seems to work properly however my problem is that when the designer serialized the newly created item it uses the wrong constructor
ControlItem controlItem1 = ((ControlItem)(new System.Windows.Forms.ListViewItem("")));
it is calling the constructor of the base class, is there a way for me to ovveride this behavior and tell it my own type to instantiate? i have tried the DesignerSerializationVisibility attribute but it does not seem to work.
here is the definition of the ListItems method
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Editor(typeof(ControlItemCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ListView.ListViewItemCollection ListItems
{
get { return Items; }
}
i would appreciate any help that could be provided. thank you.
|
|
|
|
|
This doesn't really answer your question, but rather than use inheritance to add functionality to the ListView class, why not create a user control that simply consists of a fully-docked ListView? This way, you can expose a Items collection of any type you wish. Admittedly it's more work, but you end up with a better fitting control (rather than simply tacking on new specific behavior to a very generic control).
-Phil
|
|
|
|
|
Is there a way to do this? Have been unsuccessful sofar...
Wout
|
|
|
|
|
|
Thanks Colin, I suspected so too.
Wout
|
|
|
|
|
I've got a DataGridViewComboBoxColumn that I want to bind to a datasource. However, on load, I want the DataGridViewComboBoxColumn to display values in from the column of a table.
So I'm sort of looking at a double purpose DataGridViewComboBoxColumn: i.e When in Read mode it displays values from the tables Columns, and when in Edit mode it populates the DataGridViewComboBoxColumn with additional items.
I just cant figure out how to do this.
Live in fragments no longer. Only connect.
|
|
|
|
|
Have you tried to set the datasource property? , Also Set the Display member and the value member for that specific table values you want to display in the DatagridComboBox.
Let me know how it goes
Oliekrokenosterpikkelikkeastrysvoel
|
|
|
|
|
It sounds like you want to set the DataGridViewComboBoxColumn's DisplayStyleForCurrentCellOnly property to True.
|
|
|
|
|
Hello,
I have a MasterPage with a Label that I want to display a custom description of the page and when the user clicks to different links on my website I would like that description to change. Anyone have any examples of how to do this or a site with an example?
Thanks
|
|
|
|
|
((MyMasterPage)Page.MasterPage).Label1.Text = "This is my description";
only two letters away from being an asset
|
|
|
|
|
Thanks for the prompt reply.
I'm having a hard time getting this to work.
My MasterPage is just called MasterPage.master and I tried putting the above code in the Page Load event for the content page.
I tried:
((MasterPage)Page.MasterPage).MenuLabel.Text = "Description";
After I type the first . after Page in the code Visual Studio's intellisense doesn't pick up MasterPage. I continued typing just to see what would happen and after the last ). intellisense also can't find the id for the label control. Am I doing something wrong or is there something else I may need to do?
Thanks
|
|
|
|
|
// In master page
public void SetLabel(string Text)
{
Label1.Text = Text;
}
// In default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
((MasterPage)Page.Master).SetLabel("Default Page");
}
}
only two letters away from being an asset
|
|
|
|
|
hi
i was installed WebApplicationProjectSetup, but i don't found where does it.. can anybody help me for find it ?
thanks ..
|
|
|
|
|
Please help.., how do i load a file in the application i made upon double-clicking on the file itself? I need this without going through setup and deployment actions...Please anyone?
............
|
|
|
|
|
Lyfkcd wrote: how do i load a file in the application i made upon double-clicking on the file itself
Try looking here
http://www.codeproject.com/csharp/dateparser.asp[^]
Lyfkcd wrote: I need this without going through setup and deployment actions
I have no idea what you mean by this.
only two letters away from being an asset
|
|
|
|
|
Sorry for not describing my prblem well, im just new in programming. anyway, i meant modifying the registry.., didnt had the idea before, so i wasnt able to explain it very well. I meant, the file having default icons, file type, opens my own application through clicking the file itself...etc. Thanks 4 your help...
|
|
|
|
|
Right-click the file, Open With -> Choose Program...
Jon Humphreys
ActivePlanet Software
|
|
|
|
|
OP: "upon double-clicking on the file itself"
I don't think "Right-click the file, Open With -> Choose Program..." qualifies.
only two letters away from being an asset
|
|
|
|
|
Its the pre-qualifier to "upon double-clicking on the file itself" and satisfies the "without going through setup and deployment actions" requirement.
1) Right-click the file, Open With -> Choose Program...
2) Browse for your program.
3) Check the "Always use the selected program..." and click OK
The Shell Open registry entries are then done for you without using RegEdit.
Jon Humphreys
ActivePlanet Software
|
|
|
|
|
Im sorry if i didnt quite say it.., i was wondering if how my c# application would output a file..but can in turn activate my application through clicking the file itself. Registered maybe in windows registry...having default file types, icons, etc. Thanks anyway...
|
|
|
|
|
- Open up regedit
- Goto HKEY_CLASSES_ROOT
- Create (or modify) the default value of the key which is
.ext where ext is the extension to point to another keyname e.g. extfile - Create a key under HKEY_CLASSES_ROOT called
extfile - Create a subkey called
Shell - Create a subkey called
Open - Change the default value to point to your program with
%1 being passed as an argument, %1 will be replaced by the shell with the name of the file you clicked
Hope I got that right from the top of my head
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Sure.
Now have the EXE itself check, and if first time, modify the registry to programmatically
execute those steps.
It is not difficult at all.
Now the user simply has to double click the EXE once, after that he can double click
either the EXE or one of the application's data files.
Luc Pattyn
|
|
|
|
|
thank you so much...it worked...
|
|
|
|