Then use pointer is not the same thing ?
econy
Posts
-
Function parameter question -
Function parameter questionstruct node{
int key;
node* head;
}node *head = NULL;
void func(node* &h,int n, int m)
{
if(n > m)
return;
else {
int mid = (n+m)/2;
func(h->head,n,mid-1);
func(h->head,mid+1,m);
}
}I am wonder what is the difference of parameter: func(node* &h, int n, int m) and func(node* h,int n, int m) what is the usefulness of node *&h.
-
MenuItem questionI want to change the Text of a Menuitem dynamically in runtime. I can get a Menuitem in the Menuitems collection, but it's Name property is empty.
For Each fp In My.Forms.GetType.GetProperties
If fp.Name = "BaseForm" Then
For Each mnu As MenuItem In Me.Menu.MenuItemsBut in property window, the Menuitem has Name property, it's same as a name of field variable, like: MnuBaseFile
-
MenuItem questionSolved, use Setvalue
-
MenuItem questionPublic Class BaseForm
Inherits System.Windows.Forms.Form
......
Friend WithEvents MnuBaseFile As System.Windows.Forms.MenuItem
Friend WithEvents MnuBaseWindow As System.Windows.Forms.MenuItem
Friend WithEvents MnuBaseFileExit As System.Windows.Forms.MenuItem
....
For Each fp In My.Forms.GetType.GetProperties
If fp.Name = "BaseForm" Then
For Each mnu As MenuItem In Me.Menu.MenuItemsHere I can get mnu.text = &File, But mnu.Name = "", Nothing. And I try to use the following block:
Dim fi As System.Reflection.FieldInfo() = bfType.GetFields(BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.DeclaredOnly)
For Each f As System.Reflection.FieldInfo In fi
If (f.FieldType.Name.ToString() = "MenuItem") Then
mnuNameStr = f.Name.Remove(0, 1)
End IfNow I can get field's name, but I can't use field to set text for the menu. How can I get a field's name, the Menuitem's name, then set the text for the Menuitem?
-
Reflection questionThanks
-
Reflection questionI try to use reflection to get a list of member fields in a form class.
Public Class BaseForm
Inherits System.Windows.Forms.Form
......
Friend WithEvents MnuBaseFile As System.Windows.Forms.MenuItem
Friend WithEvents MnuBaseWindow As System.Windows.Forms.MenuItem
Friend WithEvents MnuBaseFileExit As System.Windows.Forms.MenuItem
Friend WithEvents BaseFormTimer As System.Timers.Timer
Friend WithEvents MenuMainSeparator1 As System.Windows.Forms.MenuItem
Friend WithEvents HelpProvider As System.Windows.Forms.HelpProvider.....
Dim fi As System.Reflection.FieldInfo() = My.Forms.BaseForm.GetType().GetFields()But I failed, the length of fi is zero, the fi is empty array.
-
MFC multi languages UI questionI implemented a multi language UI in a MFC program, since only a few controls, so I write translation in code, I knew it can be implemented with DLL, or String Table. Now I wonder what way is better, in code, string table, or DLL,according to run time performance and space consuming. :)
-
How can I use a string as the name to search controls in an application?Some are opened, some are not
-
How can I use a string as the name to search controls in an application?The application has about 30 forms, some forms have menubars. All forms and controls are singleton pattern. I want to search all controls in the application to find a control instance with the specific string name, like, "MenuLogin". I tried Me.Controls, but it only contain the controls of the current form. Thanks
-
Generic problem of VB.NETI try to use Assembly.GetExecutingAssembly(). Thanks
-
Generic problem of VB.NETSure, Thanks. I rewrote my question. In fact, I don't want to create a new object, I just want to find the object with the name: xx-YY.
-
Generic problem of VB.NETI have some strings to represent the names of forms and controls. for example; MenuLogin = name of an instance of System.Windows.Forms.MenuItem Now I want to assign Text value to the object whose name is the string at run time. I.e:
s1 = "MenuExit"
Object(s1).Text = Exit login window //find an object,Name:MenuExitI can't find a method in the Object that can search an object with name "MenuExit" in the application. Please tell me how to implement it, thanks.
-
How to change Window.Title property?I want to change the fontsize of the Window.Title, But I found < Window FontSize = "14" > not worked for the Title, just for the content of window.
-
The difference of Style on Button and TextBlock,Thanks, Yes, I wrote code like that,I wonder why the Setter for Button not works for all Buttons without . But, the Setter for TextBlock works for all TextBlocks, don't need to type <Style StaticResource ...></x-turndown>
-
The difference of Style on Button and TextBlock,<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="20"/><Setter Property="Height" Value="36"/> <Setter Property="Width" Value="60"/> <Button Content="Button" Style="{StaticResource ButtonStyle}"/> <Button Content="Button" Style="{StaticResource ButtonStyle}" Margin="156,144,286,145" />
I am a rookie in WPF, I am wonder why the Button need : Style="{StaticResource ButtonStyle}" , a explicit Style syntax. But the TextBlock don't need it. Thanks
-
window set fontsize questionThanks
-
window set fontsize questionDon't know why the Fontsize="14" attribute not works on MenuItem, File,Login,Exit.
-
BitBlt() function performance questionThanks,image without dirctx components inside
-
BitBlt() function performance questionThe background picture is 800*600, 24 color depth, so it is about 1.44 MB. Did you think the picture size would affect the BitBlt() speed?